stnmf.plot.modules

stnmf.plot.modules(m, colors='#1b9e77', axs=None, **kwargs)

Plot the modules in a grid figure

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

  • colors (color, iterable, matplotlib.colors.Colormap, optional) – Single color or color sequence for axis frame 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 modules. If None, then no coloring is applied. Default is ‘#1b9e77’

  • axs (array_like of matplotlib.axes.Axes, optional) – Existing figure axes to draw the modules into. If None, a new figure is created. Default is None

Keyword Arguments:
  • cmap (str or matplotlib.colors.Colormap, optional) – Color map to use. 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). Default is ‘rwb’

  • localized ((l,) array_like, optional) – Indices of localized modules, where l is the number of localized modules. Not required, but if already available, may speed up figure creation. If None, localized modules are determined based on the Moran’s I threshold in moransi_threshold

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

Raises:
  • ValueError – If m has incorrect shape.

  • IndexError – If number of axs and length m do not match.