NNSOM.plots.SOMPlots.simple_grid

SOMPlots.simple_grid(avg, sizes, mouse_click=False, connect_pick_event=True, **kwargs)[source]

Generates a simple grid plot that visualizes the SOM neurons as hexagons with varying sizes and colors.

Parameters:
  • 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).

  • sizes (array-like) – An array containing the sizes to be used for the inner hexagons within each neuron, where larger values result in larger hexagons.

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

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

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