NNSOM.plots.SOMPlots.color_hist

SOMPlots.color_hist(x, avg, mouse_click=False, **kwargs)[source]

Generates a colored histogram for the SOM, where the color of each hexagon represents the corresponding value from the provided average array.

Parameters:
  • x (array-like) – The input data to be visualized in the histogram.

  • avg (array-like) – An array containing the average values to be represented by the color map, where higher values correspond to warmer colors (e.g., red) and lower values correspond to cooler colors (e.g., blue).

  • 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.

  • **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.

  • patches (list) – A list of matplotlib.patches.Patch objects representing the inner hexagons colored based on the average values.

  • text (list, optional) – A list of matplotlib.text.Text objects displaying the hit counts, included if textFlag is True in the underlying hit_hist method.

  • cbar (matplotlib.colorbar.Colorbar) – The Colorbar object attached to the plot, representing the color mapping.