morphoclass.xai.node_saliency module

Implementation of the plot_node_saliency function.

morphoclass.xai.node_saliency.plot_node_saliency(tree, grads, ax=None, rot=0, scale=1.0, edge_color='orange', width=1, center_nodes=True, show_axes=False, show_legend=True, name='grad')

Plot the node saliency for a neuronal tree.

Parameters
  • tree (tmd.Tree.Tree.Tree) – The neuronal tree to plot.

  • grads (array) – The node saliency is the absolute value of the gradients. Therefore the length of the grads sequence should be equal to the number of nodes.

  • ax (matplotlib.axes.Axes (optional)) – Plotting axes.

  • rot (float (optional)) – Rotate the neuronal tree by the given angle around the y-axis. The angle is in degrees.

  • scale (float (optional)) – Change the thickness of the plotted graph edges.

  • edge_color (str (optional)) – The color of the edges. Is passed through to NetworkX

  • width (float (optional)) – Change the thickness of the plotted graph edges.

  • center_nodes (bool (optional)) – If true then the tree will be shifted so that the first node (usually the root of the tree) is at the coordinate origin.

  • show_axes (bool (optional)) – If true then show the coordinate axes.

  • show_legend (bool (optional)) – If true then show the plot legend.

  • name (str (optional)) – The name of the saliency that will appear in the plot legend.