NNSOM.plots.SOMPlots.hit_hist

SOMPlots.hit_hist(x, textFlag=True, mouse_click=False, connect_pick_event=True, **kwargs)[source]

Generates a hit histogram for the SOM, which displays the frequency of data points assigned to each neuron. Each neuron is represented as a hexagon, and the size of each hexagon is proportional to the number of hits. Optionally, the actual number of hits can be displayed within each hexagon.

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

  • textFlag (bool, optional) – If True, displays the count of hits within each hexagon, by default True.

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

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