squidpy.pl.var_by_distance
- squidpy.pl.var_by_distance(adata, var, anchor_key, design_matrix_key='design_matrix', color=None, covariate=None, order=5, show_scatter=True, 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.design_matrix_key (
str
) – Name of the design matrix, previously computed withsquidpy.tl.var_by_distance()
, to use.anchor_key (
str
|list
[str
]) – Anchor point column from which distances are taken.covariate (
Optional
[str
]) – 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.line_palette (
Union
[str
,Sequence
[str
],Cycler
,None
]) – Categorical color palette used in case a covariate is specified.scatter_palette (
Union
[str
,Sequence
[str
],Cycler
,None
]) – Color palette for the scatter plot underlying the sns.regplotfigsize (
Optional
[tuple
[int
,int
]]) – Size of the figure in inches.scalebar_kwargs – Keyword arguments for
matplotlib_scalebar.ScaleBar()
.edges_kwargs – Keyword arguments for
networkx.draw_networkx_edges()
.kwargs – Keyword arguments for
matplotlib.pyplot.scatter()
ormatplotlib.pyplot.imshow()
.scatterplot_kwargs (
Mapping
[str
,Any
]) – Kwargs for sns.scatter
- Return type:
- Returns:
: Nothing, just plots the figure and optionally saves the plot.