locan.visualize.render_mpl.render2d.render_2d_scatter_density

locan.visualize.render_mpl.render2d.render_2d_scatter_density(locdata, loc_properties=None, other_property=None, bin_range=None, ax=None, cmap='cet_fire', cbar=True, colorbar_kws=None, **kwargs)[source]

Render localization data into a 2D image by binning x,y-coordinates into regular bins.

Prepare matplotlib.axes.Axes with image.

Note

To rescale intensity values use norm keyword.

Parameters:
  • locdata (LocData) – Localization data.

  • loc_properties (list[str] | None) – Localization properties to be grouped into bins. If None The coordinate_values of locdata are used.

  • other_property (str | None) – Localization property (columns in locdata.data) that is averaged in each pixel. If None, localization counts are shown.

  • bin_range (tuple[float, float] | Sequence[float] | Sequence[Sequence[float]] | Literal[‘zero’, ‘link’] | None) – Minimum and maximum edge for all or each dimensions with shape (2,) or (dimension, 2). If None (min, max) ranges are determined from data and returned; if ‘zero’ (0, max) ranges with max determined from data are returned. if ‘link’ (min_all, max_all) ranges with min and max determined from all combined data are returned.

  • ax (mpl.axes.Axes | None) – The axes on which to show the image

  • cmap (ColormapType) – The Colormap object used to map normalized data values to RGBA colors.

  • cbar (bool) – If true draw a colorbar. The colobar axes is accessible using the cax property.

  • colorbar_kws (dict[str, Any] | None) – Keyword arguments for matplotlib.pyplot.colorbar().

  • kwargs (Any) – Other parameters passed to mpl_scatter_density.ScatterDensityArtist.

Returns:

Axes object with the image.

Return type:

matplotlib.axes.Axes

Warning

This function is deprecated. Use third-party methods like datashader instead.