troutpy.pl.metric_scatter#
- troutpy.pl.metric_scatter(sdata, x, y, size=1, non_control_probes=None, label_top_n_x=0, label_top_n_y=0, label_bottom_n_x=0, label_bottom_n_y=0, title=None, linewidth=0.5, figures_path='', save=False, custom_plot_filename=None, palette='troutpy', group_col='is_control', control_label='Control probes', gene_label='Gene probes', show_control_probes=True)#
Plot a scatter plot of two metrics from
sdata["xrna_metadata"].var.Control and non-control probes are colored differently, and the top/bottom
ngenes along each axis can be labeled. The figure is saved with Illustrator-editable text (Type 42 fonts) and open x/y axes.- Parameters:
sdata (
SpatialData) – SpatialData object that contains anxrna_metadatatable with avarDataFrame.x (
str) – Column insdata["xrna_metadata"].varto plot on the x-axis.y (
str) – Column insdata["xrna_metadata"].varto plot on the y-axis.size (
int(default:1)) – Marker size.non_control_probes (
Optional[list[str]] (default:None)) – Ifshow_control_probesisTrue, also include these probes even ifgroup_colmarks them as controls.label_top_n_x (
int(default:0)) – Number of genes with the highestxvalues to label.label_top_n_y (
int(default:0)) – Number of genes with the highestyvalues to label.label_bottom_n_x (
int(default:0)) – Number of genes with the lowestxvalues to label.label_bottom_n_y (
int(default:0)) – Number of genes with the lowestyvalues to label.linewidth (
float(default:0.5)) – Marker edge line width.figures_path (
str(default:'')) – Directory path to save the figure.save (
bool(default:False)) – Whether to save the figure.custom_plot_filename (
Optional[str] (default:None)) – Custom filename for saving the plot.palette (
str(default:'troutpy')) – Two-color palette name, resolved viatroutpy.pl.get_palette(). Falls back to a Matplotlib colormap, then to red/blue, if neither is found.group_col (
str(default:'is_control')) – Boolean column insdata["xrna_metadata"].vardistinguishing control probes (True) from gene probes (False).control_label (
str(default:'Control probes')) – Legend label for control probes.gene_label (
str(default:'Gene probes')) – Legend label for gene probes.show_control_probes (
bool(default:True)) – Whether to include control probes in the plot.
- Return type:
- Returns:
None