sainsc.lazykde.LazyKDE.plot_KDE
- sainsc.lazykde.LazyKDE.plot_KDE(*, gene=None, remove_background=False, crop=None, scalebar=True, im_kwargs=dict(), scalebar_kwargs=SCALEBAR_PARAMS)
Plot the kernel density estimate (KDE).
By default this will plot the KDE of the total mRNA (
sainsc.LazyKDE.total_mRNA_KDE). If gene is specified the respective KDE will be computed and plotted.- Parameters:
gene (str, optional) – Gene in
sainsc.LazyKDE.genesto use for plotting.remove_background (bool, optional) – If True, all pixels for which
sainsc.LazyKDE.backgroundis False are set to 0.crop (tuple[tuple[int, int], tuple[int, int]], optional) – Coordinates to crop the data defined as ((xmin, xmax), (ymin, ymax)).
scalebar (bool, optional) – If True, add a
matplotlib_scalebar.scalebar.ScaleBarto the plot.im_kwargs (dict[str, Any], optional) – Keyword arguments that are passed to
matplotlib.pyplot.imshow().scalebar_kwargs (dict[str, Any], optional) – Keyword arguments that are passed to
matplotlib_scalebar.scalebar.ScaleBar.
- Return type:
- Raises:
ValueError – If
sainsc.LazyKDE.total_mRNA_KDEhas not been calculated.
See also