技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
plotting-reporting【数据与研究】Use for Scanpy sc.pl plotting, figure saving, headless rendering, embedding/spatial/gene/QC/marker plots, Matplotlib object handling, palettes, and plotting troubleshooting after analysis outputs already exist in AnnData.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a task is about rendering or exporting Scanpy figures from an existing anndata.AnnData object. It covers scanpy.pl APIs, figure settings, Matplotlib return objects, non-interactive execution, and common failures around colors, genes, raw/layers, spatial metadata, and saved paths.
references/plotting-workflows.md for sc.pl.embedding, sc.pl.umap, sc.pl.tsne, sc.pl.pca, sc.pl.spatial, color keys, groups, mask_obs, gene_symbols, layer, use_raw, palettes, legends, axes, and multi-panel behavior.references/plotting-workflows.md for sc.pl.dotplot, sc.pl.matrixplot, sc.pl.stacked_violin, sc.pl.heatmap, sc.pl.tracksplot, sc.pl.dendrogram, and DotPlot/MatrixPlot/StackedViolin customization.references/plotting-workflows.md for sc.pl.rank_genes_groups*, sc.pl.highly_variable_genes, sc.pl.highest_expr_genes, sc.pl.violin, PCA variance/loadings, and other reports that visualize precomputed annotations.references/figure-settings.md for matplotlib.use("Agg"), show=False, return_fig, ax, explicit figure.savefig, sc.settings.figdir, sc.settings.autoshow, sc.settings.autosave, and sc.set_figure_params.references/troubleshooting.md for missing .obsm bases, missing .obs/gene color keys, .raw versus .layers, categorical palettes, spatial image metadata, backend/display errors, and save= surprises.adata: coordinates in .obsm, annotations in .obs, genes in the selected expression source, marker results in .uns, layers in .layers, spatial metadata in .uns['spatial'], or categorical colors in .uns.Agg before importing matplotlib.pyplot, set sc.settings.autoshow = False, and pass show=False to every plotting call.ax = sc.pl.umap(adata, color='cluster', show=False) followed by ax.figure.savefig(path, dpi=200, bbox_inches='tight').return_fig=True, style the returned DotPlot, MatrixPlot, or StackedViolin object, call make_figure() when needed, then save plot.fig.matplotlib.pyplot.close(fig) or plt.close('all') to avoid memory growth and accidental figure reuse.scripts/scanpy_headless_plot_smoke.py creates a tiny synthetic AnnData, uses the Agg backend, renders UMAP/embedding/PCA and optional dotplot outputs with show=False, saves PNGs, and prints JSON. Use it as a minimal headless plotting smoke test without relying on repository files.