spacipy.Gem.plot

Gem.plot(color=None, cmap=None, category=False, ncols=6, ps=None, alpha=1, robust=False, vmin=None, vmax=None, cbar=True, font_scale=1, dark_bg=True, dx=715, units='nm', scalebar_length=50, bin_size=None, bycell=False, batch=None, metadata=None, meta_on='cell', image=None, offset_x=None, offset_y=None, ax=None, outfile=None, return_fig=False)

Plot the object in spatial coordinate

Parameters:
  • color (str, list) – Which information to plot, can be nCount, nFeature or any gene name

  • cmap (str, list) – color map used for plot, can be matplotlib colormap or hex code

  • category (bool, default False) – Whether or not the color is category

  • ncols (int) – column number for multi-panel plot

  • ps (float) – point size for scatter

  • alpha (float, between 0-1) – alpha value for transparency

  • robust (bool, default False) – color bar robust with 0.02 ~ 0.98

  • vmin (float) – minimal and maximal value for color

  • vmax (float) – minimal and maximal value for color

  • cbar (bool, default True) – Whether or not plot the color bar

  • font_scale (float) – scale value for font size

  • dark_bg (bool, default True) – Whether or not to plot in black background

  • dx (float) – deprecated scale bar parameters

  • units (float) – deprecated scale bar parameters

  • scalebar_length (float) – deprecated scale bar parameters

  • bin_size (int) – group into bins before convert with width and height of bin_size

  • bycell (bool, default False) – Whether or not plot at cell level

  • batch (str) – Column name for Batch information

  • metadata (pandas.DataFrame) – deprecated

  • meta_on (str) – deprecated

  • image (numpy.ndarray) – numpy ndarray format image matrix, will be plot as background

  • ax (matplotlib.Axis, list) – matplotlib.Axis object(s)

  • outfile (str) – save the plot in file

  • return_fig (bool, default False) – Whether or not to return the matplotlib figure