light-figure-drawinglisted
Install: claude install-skill Light0305/Light-skills
# 专业绘图与组图
## 工具选择(按图类型,附核心调用)
- 统计图/可复现图(首选):
- **matplotlib**:最可控。组图 `plt.subplots(figsize=(7,5), constrained_layout=True)`,不规则布局用 `GridSpec`(跨格 `gs[0,:]`)。
- **seaborn**:统计/分布/分类图。`sns.set_theme(style="ticks", context="paper", palette="colorblind")` + `sns.despine()`;分面拼图用 figure-level(`relplot/catplot` 的 `col=/row=`),手动拼图用 axes-level(`scatterplot(ax=...)`)。
- **plotly**:交互/3D,静态投稿 `fig.write_image("f.pdf", scale=3)`(需 `kaleido`),`template="simple_white"`。
- **altair**:声明式、可复现强。`chart.save("f.svg", scale_factor=3)`(需 `vl-convert-python`),拼图用 `c1 | c2` / `c1 & c2`。
- **ggplot2(R)**:`+ theme_classic() + scale_color_viridis_d()`,拼图用 `patchwork`(`p1+p2` 且 `plot_annotation(tag_levels="a")` 自动标号)。
- 框架图/流程图/结构图:
- **Graphviz**(自动布局):`digraph{rankdir=LR; node[shape=box,style=rounded]; A->B}`,选对引擎 `dot`(分层)/`neato`(无向)/`fdp`(大图),`rank=same` 对齐同层。
- **TikZ/PGFPlots**(字体与正文统一):`\begin{axis}...\addplot table{data.dat};`,导言区 `\pgfplotsset{compat=1.18}` 统一样式,大图用 `external` 库缓存。
- **Mermaid**(文档/初稿):`graph TD; A[框]-->|标签|B{判断}`,`mmdc -i in.mmd -o out.svg` 导出。
- 精修拼版:Illustrator / Inkscape。
- 精细科学图/期刊曲线:
- **Origin**:Export Graphs 按出版商精确设 Width/Height+DPI(TIFF 600dpi),可 `Export as AI` 转 Illustrator;.otp 模板固化风格。
- **MATLAB**:`exportgraphics(ax,"f.pdf","ContentType","vector")` 出矢量、`"Resolution",600` 出位图;组图用 `tiledlayout` + `nexttile`(`TileSpacing="compact"`)。
- 示意/机制图/graphical abstract:**BioRender**(生命科学图标库,注意导出授权与分辨率)。
- 组图/排版:matplotlib subplots/GridSpec、Illustrato