publication-chart-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePublication Chart Skill
出版级图表技能
Goal
目标
Use this skill to turn research results into publication-grade figures and tables with an end-to-end workflow.
Primary production stack:
- for figures
pubfig - for publication tables
pubtab
This skill covers the full delivery chain:
- understand the scientific communication goal,
- choose the right artifact type,
- map the task to ,
pubfig, or both,pubtab - generate concrete runnable instructions,
- export paper-ready assets,
- run publication QA,
- propose targeted revisions.
使用本技能通过端到端工作流将研究结果转换为出版级图表和表格。
核心技术栈:
- :用于生成图表
pubfig - :用于生成出版级表格
pubtab
本技能覆盖完整交付流程:
- 理解科学传播目标,
- 选择合适的成果类型,
- 将任务映射到、
pubfig或两者结合,pubtab - 生成可直接运行的具体指令,
- 导出可直接用于论文的资源,
- 执行出版质量检查,
- 提出针对性修订方案。
Use this skill when
适用场景
Trigger this skill for requests like:
- “make a publication-quality figure”
- “choose the right chart for these results”
- “turn these results into a paper-ready figure”
- “make a benchmark / ablation / calibration / forest / heatmap / scatter / line / bar figure”
- “make a benchmark / appendix / ablation table from Excel”
- “convert this Excel table into publication-ready LaTeX”
- “prepare one summary figure plus one companion table for the results section”
- “review and improve this scientific figure/table”
- “I already have a weak chart / screenshot / draft plot — make it publication-ready”
- “export panels for a paper figure”
在用户提出以下需求时触发本技能:
- “制作一张出版级图表”
- “为这些结果选择合适的图表类型”
- “将这些结果转换为可直接用于论文的图表”
- “制作基准/消融/校准/森林图/热力图/散点图/折线图/柱状图”
- “从Excel制作基准/附录/消融表格”
- “将这个Excel表格转换为可用于出版的LaTeX格式”
- “为结果部分准备一张汇总图表和一张配套表格”
- “审核并优化这张科学图表/表格”
- “我已有一张不够完善的图表/截图/草稿图——将它优化为出版级”
- “导出论文图表的各个面板”
Do not use this skill for
不适用场景
Do not use this skill when the task is mainly:
- manuscript prose writing,
- statistical testing without artifact design,
- raw exploratory analysis with no publication deliverable,
- Figma-first layout work before the figure/table content is solid.
For simple composite assembly after the figure content is already strong, use the optional secondary workflow in .
references/composite-assembly.md当任务主要为以下内容时,请勿使用本技能:
- 论文正文写作,
- 无成果设计的统计测试,
- 无出版交付物的原始探索性分析,
- 图表/表格内容未确定前的Figma优先布局工作。
若图表内容已完善,仅需简单组合排版,可使用中的可选次级工作流。
references/composite-assembly.mdPrimary contract
核心约定
Inputs
输入
Expect some combination of:
- the scientific communication goal,
- available data shape,
- venue or style constraints,
- whether the artifact is a figure, table, or mixed deliverable,
- optional existing assets such as code, spreadsheets, , screenshots, or draft plots,
.tex - whether the user needs a first draft, a publication-ready artifact, or a review/revision pass.
预期包含以下部分或全部内容:
- 科学传播目标,
- 可用数据的形态,
- 期刊或格式约束,
- 成果类型为图表、表格或两者结合,
- 可选的现有资源,如代码、电子表格、文件、截图或草稿图,
.tex - 用户需求为初稿、出版级成果还是审核/修订版本。
Outputs
输出
The minimum useful output is:
- the recommended figure/table form,
- the recommended /
pubfigroute,pubtab - a minimal runnable code snippet or CLI command,
- explicit export filenames and formats,
- a publication QA summary,
- and, when needed, a revision plan.
最低有效输出需包含:
- 推荐的图表/表格形式,
- 推荐的/
pubfig使用路径,pubtab - 最简可运行代码片段或CLI命令,
- 明确的导出文件名和格式,
- 出版质量检查总结,
- 必要时提供修订计划。
Default workflow
默认工作流
0. Probe the environment and artifact state
0. 探查环境与成果状态
Before generating anything, identify:
- whether or
pubfigis actually available,pubtab - whether the user already has code / spreadsheets / / screenshots,
.tex - whether the deliverable is a fresh build or a revision,
- whether the result needs exact values, fast visual perception, or both.
Prefer the smallest environment check that helps execution. When the bundled helper script is available, use it first:
python3 scripts/ensure_publication_tooling.py --require pubfig --jsonpython3 scripts/ensure_publication_tooling.py --require pubtab --json
Equivalent manual checks are still acceptable when needed:
python -c "import pubfig; print(pubfig.__version__)"python -c "import pubtab; print(pubtab.__version__)"pubtab --help
Report the result clearly as available or missing.
If a dependency is missing and the task requires runnable execution:
- auto-install it by default,
- prefer the user’s active environment instead of guessing a random global interpreter,
- use as the default bundled route when the script is present,
python3 scripts/ensure_publication_tooling.py --require ... - let that helper choose vs
uvagainst the active interpreter,python -m pip - re-run the availability probe after installation,
- and only then continue with the artifact workflow.
Equivalent concrete commands include:
python3 scripts/ensure_publication_tooling.py --require pubfigpython3 scripts/ensure_publication_tooling.py --require pubtabuv pip install pubfiguv pip install pubtabpython -m pip install pubfigpython -m pip install pubtab
If auto-install fails, report the exact failure and then degrade gracefully.
Do not block on a full environment audit.
在生成任何内容前,先确认:
- 或
pubfig是否实际可用,pubtab - 用户是否已有代码/电子表格/文件/截图,
.tex - 交付物是全新制作还是修订版本,
- 结果是否需要精确数值、快速视觉感知或两者兼顾。
优先执行最小化环境检查以辅助执行。当捆绑辅助脚本可用时,优先使用:
python3 scripts/ensure_publication_tooling.py --require pubfig --jsonpython3 scripts/ensure_publication_tooling.py --require pubtab --json
必要时也可接受等效手动检查:
python -c "import pubfig; print(pubfig.__version__)"python -c "import pubtab; print(pubtab.__version__)"pubtab --help
清晰报告结果为可用或缺失。
若依赖缺失且任务需要可执行的内容:
- 默认自动安装,
- 优先使用用户的活跃环境而非全局解释器,
- 当脚本存在时,默认使用作为捆绑安装路径,
python3 scripts/ensure_publication_tooling.py --require ... - 让辅助脚本针对活跃解释器选择或
uv,python -m pip - 安装后重新运行可用性探查,
- 之后再继续成果工作流。
等效具体命令包括:
python3 scripts/ensure_publication_tooling.py --require pubfigpython3 scripts/ensure_publication_tooling.py --require pubtabuv pip install pubfiguv pip install pubtabpython -m pip install pubfigpython -m pip install pubtab
若自动安装失败,报告具体错误后优雅降级处理。
无需等待完整环境审核完成。
1. Classify the task
1. 任务分类
Classify the request along these axes:
- artifact type: figure / table / mixed deliverable
- maturity: exploratory draft / publication-ready generation / revision of an existing artifact
- structure: single panel / multi-panel / figure-plus-table package
- evidence mode: pattern perception / exact value lookup / both
Do not jump into plotting code before the communication target is clear.
从以下维度对请求进行分类:
- 成果类型:图表/表格/混合交付物
- 成熟度:探索性草稿/出版级生成/现有成果修订
- 结构:单面板/多面板/图表加表格组合
- 证据模式:模式感知/精确数值查询/两者兼顾
在明确传播目标前,不要直接进入绘图代码编写。
2. Choose the representation
2. 选择呈现方式
Choose the representation based on the scientific claim, not novelty or visual flair.
Common families:
- comparison — grouped scatter, bar, line comparison, benchmark summary, companion table
- ablation — grouped comparison, dumbbell, paired comparison, compact table
- distribution — box, violin, raincloud, histogram, density, ECDF, QQ
- relationship — scatter, bubble, contour2d, hexbin
- trend — line, area
- evaluation / diagnostic — calibration, ROC, PR, Bland–Altman, forest plot, volcano
- composition / hierarchy — UpSet, stacked ratio, donut, radial hierarchy, circular grouped or stacked bars
- table — benchmark table, ablation table, dataset summary, appendix table, error breakdown
Avoid weak defaults:
- avoid pie/donut when exact comparison matters and a bar/table is clearer,
- avoid radar unless the comparison is genuinely profile-like and low-cardinality,
- avoid 3D, decorative gradients, and dense legends used only for style,
- avoid forcing every result into a figure when a publication table communicates the evidence better.
If the request is ambiguous, explicitly state what scientific claim the artifact is supposed to support.
基于科学结论选择呈现方式,而非追求新颖性或视觉效果。
常见类型:
- 对比——分组散点图、柱状图、折线对比图、基准汇总表、配套表格
- 消融实验——分组对比图、哑铃图、配对对比图、紧凑表格
- 分布——箱线图、小提琴图、雨云图、直方图、密度图、ECDF、QQ图
- 关系——散点图、气泡图、2D等高线图、六边形分箱图
- 趋势——折线图、面积图
- 评估/诊断——校准图、ROC曲线、PR曲线、Bland–Altman图、森林图、火山图
- 组成/层级——UpSet图、堆叠比例图、环形图、径向层级图、环形分组/堆叠柱状图
- 表格——基准表、消融实验表、数据集汇总表、附录表格、错误分解表
避免不合理默认选项:
- 当精确对比很重要时,避免使用饼图/环形图,改用柱状图/表格更清晰,
- 除非对比确实是低基数的轮廓类对比,否则避免使用雷达图,
- 避免3D效果、装饰性渐变和仅用于风格的密集图例,
- 当出版级表格能更好传达证据时,避免强行将所有结果转换为图表。
若请求模糊,需明确说明成果应支持的科学结论。
3. Map to the toolchain
3. 映射到工具链
Default mapping:
- Figures →
pubfig - Tables →
pubtab - Mixed deliverables → use both, with each artifact carrying a distinct role
Tool roles:
- is the default figure engine for scientific plots and paper-ready export.
pubfig - is the default table engine for Excel ↔ LaTeX workflows, preview, and publication-ready table export.
pubtab - Figma/composite assembly is an optional secondary branch for multi-panel finishing.
Route selection rules:
- prefer Python for figure generation,
pubfig - prefer CLI for when the task is file-driven,
pubtab - prefer Python for when the task is already inside a notebook or scripted pipeline,
pubtab - keep the figure and table responsibilities separate in mixed requests.
默认映射规则:
- 图表 →
pubfig - 表格 →
pubtab - 混合交付物 → 两者结合,每个成果承担不同角色
工具角色:
- 是科学绘图和论文级导出的默认图表引擎。
pubfig - 是Excel ↔ LaTeX工作流、预览和出版级表格导出的默认表格引擎。
pubtab - Figma/组合排版是可选次级分支,用于多面板收尾。
路径选择规则:
- 图表生成优先使用Python,
pubfig - 当任务为文件驱动时,优先使用CLI,
pubtab - 当任务已在笔记本或脚本化流程中时,优先使用Python,
pubtab - 混合请求中需明确区分图表和表格的职责。
4. Generate concrete artifact instructions
4. 生成具体成果指令
Prefer the smallest production-ready artifact first:
- minimal runnable Python for , or
pubfig - minimal CLI/Python for
pubtab
Then add publication parameters only when justified:
- labels, caption, width, export format, backend, preview, panel packaging, or composite layout.
Keep filenames and suffixes explicit.
Good defaults:
- figures: one call + one
pubfigsave_figure(...) - multiple figure outputs:
batch_export(...) - tables: one or
pubtab xlsx2tex ...pubtab.preview ... - mixed requests: one figure route + one table route, clearly separated
优先生成最小化可投产成果:
- 的最简可运行Python代码,或
pubfig - 的最简CLI/Python代码
pubtab
仅在必要时添加出版参数:
- 标签、标题、宽度、导出格式、后端、预览、面板打包或组合布局。
明确文件名和后缀。
推荐默认选项:
- 图表:一次调用 + 一次
pubfigsave_figure(...) - 多图表输出:
batch_export(...) - 表格:一次或
pubtab xlsx2tex ...pubtab.preview ... - 混合请求:分别给出图表路径和表格路径,清晰区分
5. Define the delivery contract
5. 定义交付约定
For every response, make these explicit when possible:
- the claim the artifact supports,
- which part is handled by and which by
pubfig,pubtab - the output filenames,
- the output formats,
- whether the artifact is draft / final / revision,
- what still needs user-provided data or manuscript context.
尽可能在每个响应中明确以下内容:
- 成果支持的结论,
- 和
pubfig各自处理的部分,pubtab - 输出文件名,
- 输出格式,
- 成果为草稿/最终版/修订版,
- 仍需用户提供的数据或论文上下文。
6. Run publication QA
6. 执行出版质量检查
After generation, check:
- title and legend density,
- axis labels and units,
- category ordering and baseline clarity,
- color accessibility and grayscale robustness,
- font / line-weight consistency,
- caption readiness,
- figure/table readability after downscaling,
- panel consistency for multi-panel figures,
- venue-fit issues such as width, crowding, or over-annotation.
The QA output must be concrete. Do not say “looks better” without naming why.
生成成果后,检查以下内容:
- 标题和图例密度,
- 坐标轴标签和单位,
- 类别排序和基线清晰度,
- 颜色可访问性和灰度鲁棒性,
- 字体/线条粗细一致性,
- 标题就绪度,
- 缩小后图表/表格的可读性,
- 多面板图表的面板一致性,
- 适配期刊的问题,如宽度、拥挤或过度标注。
质量检查输出必须具体,不能只说“看起来更好”而不说明原因。
7. Revise
7. 修订
If the result is weak, revise with specific changes such as:
- switch chart family,
- remove chartjunk,
- reorder categories,
- move exact values into a table,
- split a crowded panel,
- add or simplify the caption,
- change export width,
- or convert the deliverable from figure-first to table-first.
若成果质量不佳,进行针对性修改,例如:
- 切换图表类型,
- 移除冗余图表元素,
- 重新排序类别,
- 将精确数值移至表格,
- 拆分拥挤的面板,
- 添加或简化标题,
- 修改导出宽度,
- 或将交付物从优先图表改为优先表格。
Missing dependency behavior
依赖缺失处理
If or is not available:
pubfigpubtab- do not fail immediately,
- first attempt automatic installation into the active environment,
- prefer when the bundled script exists,
python3 scripts/ensure_publication_tooling.py --require ... - explicitly state which dependency is missing,
- state which install command or helper route is being used,
- re-check availability after installation,
- if installation succeeds, continue with the runnable workflow,
- if installation fails, degrade to a design/specification workflow,
- provide pseudocode or draft commands,
- preserve the recommended figure/table structure,
- still provide QA and revision guidance.
若或不可用:
pubfigpubtab- 不要立即失败,
- 先尝试自动安装到活跃环境,
- 当捆绑脚本存在时,优先使用,
python3 scripts/ensure_publication_tooling.py --require ... - 明确说明缺失的依赖,
- 说明正在使用的安装命令或辅助路径,
- 安装后重新检查可用性,
- 若安装成功,继续可运行工作流,
- 若安装失败,降级为设计/规范工作流,
- 提供伪代码或草稿命令,
- 保留推荐的图表/表格结构,
- 仍提供质量检查和修订指导。
Composite assembly rule
组合排版规则
Treat composite or Figma assembly as secondary:
- use it when the user explicitly wants a multi-panel paper figure,
- or when panel-level export and layout polishing are genuinely needed.
Do not escalate simple figure tasks into composite/Figma workflows by default.
将组合或Figma排版视为次级任务:
- 仅当用户明确需要多面板论文图表时使用,
- 或确实需要面板级导出和布局优化时使用。
默认情况下,不要将简单图表任务升级为组合/Figma工作流。
Output style rules
输出风格规则
- Prefer direct, implementation-usable outputs.
- Explain the why of chart/table choice briefly, then give the runnable route.
- When execution matters, include a short environment status block such as ,
pubfig: available/missing.pubtab: available/missing - If a dependency is missing, state the exact helper command or install command, perform the installation, and report the post-install status.
- When a table is stronger than a figure, say so explicitly.
- When a figure is stronger than a table, say so explicitly.
- When both are needed, assign them different communication roles.
- Keep revision guidance actionable and falsifiable.
- 优先提供直接可用于实现的输出。
- 简要说明选择图表/表格的原因,然后给出可运行路径。
- 当执行很重要时,添加简短的环境状态块,如、
pubfig: available/missing。pubtab: available/missing - 若依赖缺失,说明具体的辅助命令或安装命令,执行安装并报告安装后状态。
- 当表格比图表更合适时,明确说明。
- 当图表比表格更合适时,明确说明。
- 当两者都需要时,为它们分配不同的传播角色。
- 修订指导需可操作且可验证。
Recommended response shape
推荐响应结构
A strong response using this skill usually has 6 parts:
- Artifact decision — figure / table / paired deliverable, and why
- Tool route — ,
pubfig, or bothpubtab - Minimal implementation — runnable code or CLI
- Export plan — filenames, formats, width/backend/preview choices
- Publication QA — what to verify before paper submission
- Revision plan — what to change if the current artifact is weak
使用本技能的优质响应通常包含6部分:
- 成果决策——图表/表格/组合交付物及原因
- 工具路径——、
pubfig或两者结合pubtab - 最简实现——可运行代码或CLI命令
- 导出计划——文件名、格式、宽度/后端/预览选择
- 出版质量检查——论文提交前需验证的内容
- 修订计划——当前成果不佳时的修改方向
Resources
资源
Load these as needed:
- — full end-to-end decision order and delivery contract
references/workflow.md - — task-to-chart mapping and anti-patterns
references/chart-selection.md - — environment probing, forced install behavior, and runnable verification
references/execution-and-verification.md - — bundled probe + auto-install helper for
scripts/ensure_publication_tooling.py/pubfigpubtab - — shortest useful figure patterns and export routes
references/pubfig-recipes.md - — shortest useful table routes and backend guidance
references/pubtab-recipes.md - — package layout and figure-generation boundaries from source
references/source-guides/pubfig-architecture.md - — stable public pubfig surface and chart-family map from
references/source-guides/pubfig-api-map.md__init__.py - — figure export, publication sizing, and panel-export flow from source
references/source-guides/pubfig-export-flow.md - — package layout and forward/reverse conversion architecture from source
references/source-guides/pubtab-architecture.md - — CLI-to-API control flow and batch/sheet behavior from source
references/source-guides/pubtab-cli-api-flow.md - — backend/theme split and real preview compile pipeline from source
references/source-guides/pubtab-backend-and-preview.md - — figure/table QA checklist
references/publication-qa-checklist.md - — optional multi-panel and Figma branch
references/composite-assembly.md
For prompt-shaped examples, see .
examples/按需加载以下资源:
- ——完整端到端决策顺序和交付约定
references/workflow.md - ——任务到图表的映射及反模式
references/chart-selection.md - ——环境探查、强制安装行为及可运行验证
references/execution-and-verification.md - ——用于
scripts/ensure_publication_tooling.py/pubfig的捆绑探查+自动安装辅助脚本pubtab - ——最简实用图表模式和导出路径
references/pubfig-recipes.md - ——最简实用表格路径和后端指导
references/pubtab-recipes.md - ——源码中的包布局和图表生成边界
references/source-guides/pubfig-architecture.md - ——来自
references/source-guides/pubfig-api-map.md的稳定pubfig公共接口和图表类型映射__init__.py - ——源码中的图表导出、出版尺寸和面板导出流程
references/source-guides/pubfig-export-flow.md - ——源码中的包布局和正向/反向转换架构
references/source-guides/pubtab-architecture.md - ——源码中的CLI到API控制流及批量/工作表行为
references/source-guides/pubtab-cli-api-flow.md - ——源码中的后端/主题拆分和实时预览编译流程
references/source-guides/pubtab-backend-and-preview.md - ——图表/表格质量检查清单
references/publication-qa-checklist.md - ——可选多面板和Figma分支
references/composite-assembly.md
提示式示例请查看目录。
examples/