import cellestial as cl
import scanpy as sc
from lets_plot import *
LetsPlot.setup_html()
= sc.read("data/pbmc3k_mini.h5ad") data
11 boxplot
11.1 A simple boxplot
cl.boxplot(
data,"pct_counts_in_top_50_genes",
="sample",
fill="#3f3f3f",
boxplot_color=True,
show_points=1,
outlier_shape )
11.2 Fill splits the data as in ggplot2
= cl.boxplot(
plot
data,"pct_counts_in_top_50_genes",
="leiden",
fill="#3f3f3f",
boxplot_color=True,
show_points=1,
outlier_shape+ ggsize(1000, 400)
)
plot
11.3 Customize the plot
+= scale_fill_brewer(palette="Set2") + scale_y_log2()
plot plot
11.4 Turn it into a interactive plot
Even if you did not create the plot with interactive = True
you can still make it interactive with +ggtb()
by lets_plot.
+= ggtb()
plot plot
cl.versions()
cellestial: 0.2.0
scanpy: 1.10.4
anndata: 0.11.0
polars: 1.12.0