stnmf.plot.all

stnmf.plot.all(s, m, s_outl, m_outl, w=None, autocorr=None, pixel_size=None, colors='hsv', **kwargs)

Create figure combining the modules, their outlines, the spike-triggered average (STA), and - optionally - the weights and autocorrelation values

Parameters:
  • s ((x,y) array_like) – Spatial spike triggered average (STA), where x and y are the spatial dimensions

  • m ((r,x,y) array_like) – Spatial modules, where r is the number of modules and x and y are the spatial dimensions

  • s_outl ((n,2) array_like) – Outline of STA with n coordinate pairs. Default is None

  • m_outl ((l,) array_like) – Outlines of the l localized subunits. Each element is an (2, n) array_like containing n coordinate pairs. n may be different for each outline. Outlines may be arbitrary, i.e. either contours or ellipses.

  • w ((r,) or (r,sp) array_like, optional) – Weight or weights of each module. Either already averaged (r,) or all weights (r, sp), where r is the number of modules and sp is the number of spikes. If None, weights and autocorrelation plots are omitted (reduced figure). Default is None

  • autocorr ((r,) array_like, optional) – Moran’s I of each spatial modules. Not required, but if already available, may speed up figure creation. Default is None

  • pixel_size (float, optional) – Size of a stimulus pixel (stixel) in micrometers (μm) for displaying the scale bar. If not specified, no scale bar is shown. Default is None

  • colors (color, iterable, matplotlib.colors.Colormap, optional) – Single color or color sequence to differentiate localized modules. If single color, the same color is used on the plots of all localized subunits. If iterable or colormap, colors are iterated over plots of localized subunits. Default is ‘hsv’

Keyword Arguments:
  • cmap (str or matplotlib.colors.Colormap, optional) – Override colormaps for both STA and modules. By default the modules and STA plots have two different colormaps. If specified, the colormap is used for all subplots. Recommended are ‘rwb’ for convenient view (red-white-black with masked values lightseagreen) and ‘filter’ for conventional spatial contrast filter colors (black-gray-white with masked values magenta). If None, modules are visualized with ‘rwb’ and STA with ‘filter’. Default is None

  • moransi_threshold (float, optional) – Moran’s I threshold to differentiate localized modules. Default is 0.25

Returns:

fig (matplotlib.figure.Figure) – Created figure

Raises:
  • ValueError – If s, m, outl, or w have incorrect shape.

  • IndexError – If the spatial dimensions of s and m do not match.