squidpy.pl.var_by_distance
- squidpy.pl.var_by_distance(adata, var, anchor_key, design_matrix_key='design_matrix', stack_vars=False, covariate=None, order=5, show_scatter=True, color=None, line_palette=None, scatter_palette='viridis', dpi=None, figsize=None, save=None, title=None, axis_label=None, return_ax=None, regplot_kwargs=mappingproxy({}), scatterplot_kwargs=mappingproxy({}))[source]
Plot a variable using a smooth regression line with increasing distance to an anchor point.
- Parameters:
adata (
AnnData) – Annotated data object.anchor_key (
str|list[str]) – Anchor point column from which distances are taken.design_matrix_key (
str) – Name of the design matrix, previously computed withsquidpy.tl.var_by_distance(), to use.stack_vars (
bool) – Whether to show multiple variables on the same plot. Only works if ‘covariate’ is not specified.covariate (
str|None) – A covariate for which separate regression lines are plotted for each category.order (
int) – Order of the polynomial fit forseaborn.regplot().show_scatter (
bool) – Whether to show a scatter plot underlying the regression line.color (
str|None) – Variables in adata.obs to plot if ‘show_scatter==True’.line_palette (
str|Sequence[str] |Cycler|None) – Categorical color palette used in case a covariate is specified.scatter_palette (
str|Sequence[str] |Cycler|None) – Color palette for the scatter plot underlying theseaborn.regplot().figsize (
tuple[int,int] |None) – Size of the figure in inches.return_ax (
bool|None) – Whether to returnmatplotlib.axes.Axesobject(s).regplot_kwargs (
Mapping[str,Any]) – Kwargs forseaborn.regplot().scatterplot_kwargs (
Mapping[str,Any]) – Kwargs formatplotlib.pyplot.scatter().
- Return type:
- Returns:
Nothing, just plots the figure and optionally saves the plot.