neurom.view.view.tree3d

neurom.view.view.tree3d(tr, new_fig=True, new_axes=True, subplot=False, **kwargs)

Generates a figure of the tree in 3d. If the tree contains one single point the plot will be empty since no segments can be constructed.

Parameters:
  • tr – Tree neurom.Tree object
  • diameter – boolean If True the diameter, scaled with diameter_scale factor, will define the width of the tree lines. If False use linewidth to select the width of the tree lines. Default value is True.
  • diameter_scale – float Defines the scale factor that will be multiplied with the diameter to define the width of the tree line. Default value is 1.
  • white_space – float Defines the white space around the boundary box of the morphology. Default value is 1. new_fig: boolean Defines if the tree will be plotted in the current figure (False) or in a new figure (True) Default value is True.
  • subplot – matplotlib subplot value or False If False the default subplot 111 will be used. For any other value a matplotlib subplot will be generated. Default value is False.
  • treecolor – str or None Defines the color of the tree. If None the default values will be used, depending on the type of tree: Basal dendrite: “red” Axon : “blue” Apical dendrite: “purple” Undefined tree: “black” Default value is None.
  • linewidth – float Defines the linewidth of the tree, if diameter is set to False. Default value is 1.2.
  • alpha – float Defines throughe transparency of the tree. 0.0 transparent through 1.0 opaque. Default value is 0.8.
  • pretitle (Optional[str]) – String to include before the general title of the figure. Default value is None.
  • posttitle (Optional[str[) – String to include after the general title of the figure. Default value is None.
  • prefile (Optional[str]) – String to include before the general filename of the figure. Default value is None.
  • postfile (Optional[str]) – String to include after the general filename of the figure. Default value is None.
  • title (Optional[str]) – Set the title for the figure. If “” no title will be added. Default value is “Figure”.
  • title_fontsize (Optional[int]) – Defines the size of the title’s font. Default value is 14.
  • title_arg (Optional[dict]) – Defines the arguments that will be passsed into matplotlib as title arguments. Default value is None.
  • xlabel (Optional[str]) – The xlabel for the figure. For no_xlabel set to ‘’. Default value is “X”.
  • ylabel (Optional[str]) – The xlabel for the figure. For no_ylabel set to ‘’. Default value is “Y”.
  • zlabel (Optional[str]) – The zlabel for the figure. For no_zlabel set to ‘’. Default value is “Z”.
  • label_fontsize (Optional[int]) – Defines the size of the labels’ font. Default value is 14.
  • xlabel_arg (Optional[dict]) – Defines the arguments that will be passsed into matplotlib as xlabel arguments. Default value is None.
  • ylabel_arg (Optional[dict]) – Defines the arguments that will be passsed into matplotlib as ylabel arguments. Default value is None.
  • zlabel_arg (Optional[dict]) – Defines the arguments that will be passsed, into matplotlib as zlabel arguments. Default value is None.
  • xticks (Optional[list of ticks]) – Defines the values of x ticks in the figure. If None the xticks will not be modified. For no_xticks set to []. Default value is None.
  • yticks (Optional[list of ticks]) – Defines the values of y ticks in the figure. If None the yticks will not be modified. For no_yticks set to []. Default value is None.
  • zticks (Optional[list of ticks]) – Defines the values of z ticks in the figure. If None the zticks will not be modified. For no_zticks set to []. Default value is None.
  • tick_fontsize (Optional[int]) – Defines the size of the ticks’ font. Default value is 12.
  • xticks_arg (Optional[dict]) – Defines the arguments that will be passsed into matplotlib as xticks arguments. Default value is None.
  • yticks_arg (Optional[dict]) – Defines the arguments that will be passsed into matplotlib as yticks arguments. Default value is None.
  • zticks_arg (Optional[dict]) – Defines the arguments that will be passsed into matplotlib as zticks arguments. Default value is None.
  • xlim (Optional[list of two floats]) – Defines the min and the max values in x-axis. Default in None
  • ylim (Optional[list of two floats]) – Defines the min and the max values in y-axis. Default in None
  • zlim (Optional[list of two floats]) – Defines the min and the max values in z-axis. Default in None
  • no_legend (Optional[boolean]) – Defines the presence of a legend in the figure. If True the legend will not be included in the Figure. Default value is True.
  • legend_arg (Optional[dict]) – Defines the arguments that will be passsed into matplotlib as legend arguments. Default value is None.
  • show_plot (bool) – If True the figure is displayed. Default value is True.
  • no_axes (bool) – If True the labels and the frame will be set off. Default value is False.
  • tight (bool) – If True the set layout of matplotlib will be activated. Default value is False.
  • output_path (str) – String to define the path to the output directory. Default value is ‘./’
  • output_name (str) – String to define the name of the output figure. Default value is ‘Figure’
  • output_format (Optional[str]) – String to define the format of the output figure. Default value is ‘png’
  • dpi (Optional[int]) – Define the DPI (Dots per Inch) of the figure. Default value is 300.
  • transparent (Optional(bool) – If True the saved figure will have a transparent background. Default value is False.
  • aspect_ratio (Optional(str) – Defines the aspect ratio of the figure, according to matplotlib default options. For equal aspect ratio select ‘equal’. For normal aspect ration select ‘auto’. Default value is set to ‘equal’.
Returns:

Matplotlib figure, matplotlib axes