NNSOM.plots.SOMPlots.plt_pie

SOMPlots.plt_pie(x, s=None, mouse_click=False, connect_pick_event=True, **kwargs)[source]

Generates a pie chart visualization for the SOM, displaying the composition of each neuron’s data or cluster.

Parameters:
  • x (array-like) – A 2D array or sequence of vectors, where each row represents the composition or category values for a single neuron.

  • s (array-like, optional) – An array containing the percentage values to be used for scaling the pie chart sizes, by default None.

  • mouse_click (bool, optional) – If True, enables the plot to respond to mouse clicks, allowing for interactive functionality such as querying or modifying neuron data, by default False.

  • connect_pick_event (bool, optional) – If True, connects a pick event that triggers when a neuron is clicked, by default True.

  • **kwargs (dict) – Arbitrary keyword arguments that can be passed to the event handler onpick when an interactive element is clicked. Common parameters could include data specific to the plot or visualization settings.

Returns:

  • fig (matplotlib.figure.Figure) – The Figure object containing the plot.

  • ax (matplotlib.axes.Axes) – The Axes object containing the plot elements.

  • h_axes (list) – A list of matplotlib.axes.Axes objects, each containing a pie chart for a single neuron’s composition.

Raises:

ValueError – If the length of x or s (if provided) does not match the number of neurons, or if the percentage values in s are not between 0 and 100.