cellrank.ul.models.FittedModel.plot
- FittedModel.plot(figsize=(8, 5), same_plot=False, hide_cells=False, perc=None, abs_prob_cmap=<matplotlib.colors.ListedColormap object>, cell_color=None, lineage_color='black', alpha=0.8, lineage_alpha=0.2, title=None, size=15, lw=2, cbar=True, margins=0.015, xlabel='pseudotime', ylabel='expression', conf_int=True, lineage_probability=False, lineage_probability_conf_int=False, lineage_probability_color=None, obs_legend_loc='best', dpi=None, fig=None, ax=None, return_fig=False, save=None, **kwargs)
Plot the smoothed gene expression.
- Parameters
same_plot (
bool
) – Whether to plot all trends in the same plot.hide_cells (
bool
) – Whether to hide the cells.perc (
Optional
[Tuple
[float
,float
]]) – Percentile by which to clip the absorption probabilities.abs_prob_cmap (
ListedColormap
) – Colormap to use when coloring in the absorption probabilities.cell_color (
Optional
[str
]) – Key inanndata.AnnData.obs
oranndata.AnnData.var_names
used for coloring the cells.lineage_color (
str
) – Color for the lineage.alpha (
float
) – Alpha channel for cells.lineage_alpha (
float
) – Alpha channel for lineage confidence intervals.size (
int
) – Size of the points.lw (
float
) – Line width for the smoothed values.cbar (
bool
) – Whether to show colorbar.margins (
float
) – Margins around the plot.xlabel (
str
) – Label on the x-axis.ylabel (
str
) – Label on the y-axis.conf_int (
bool
) – Whether to show the confidence interval.lineage_probability (
bool
) – Whether to show smoothed lineage probability as a dashed line. Note that this will require 1 additional model fit.lineage_probability_conf_int (
Union
[bool
,float
]) – Whether to compute and show smoothed lineage probability confidence interval. Ifself
iscellrank.ul.models.GAMR
, it can also specify the confidence level, the default is 0.95. Only used whenshow_lineage_probability=True
.lineage_probability_color (
Optional
[str
]) – Color to use when plotting the smoothedlineage_probability
. If None, it’s the same aslineage_color
. Only used whenshow_lineage_probability=True
.obs_legend_loc (
Optional
[str
]) – Location of the legend whencell_color
corresponds to a categorical variable.fig (
Optional
[Figure
]) – Figure to use, if None, create a new one.ax (
matplotlib.axes.Axes
) – Ax to use, if None, create a new one.return_fig (
bool
) – If True, return the figure object.save (
Optional
[str
]) – Filename where to save the plot. If None, just shows the plots.kwargs – Keyword arguments for
matplotlib.axes.Axes.legend()
, e.g. to disable the legend, specifyloc=None
. Only available whenshow_lineage_probability=True
.
- Return type
- Returns
Nothing, just plots the figure. Optionally saves it based on
save
.