Publication 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:
pubfig for figures
pubtab for publication tables
This skill covers the full delivery chain:
- understand the scientific communication goal,
- choose the right artifact type,
- map the task to
pubfig, pubtab, or both,
- generate concrete runnable instructions,
- export paper-ready assets,
- run publication QA,
- propose targeted revisions.
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”
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.
Primary 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,
.tex, screenshots, or draft plots,
- whether the user needs a first draft, a publication-ready artifact, or a review/revision pass.
Outputs
The minimum useful output is:
- the recommended figure/table form,
- the recommended
pubfig / pubtab route,
- a minimal runnable code snippet or CLI command,
- explicit export filenames and formats,
- a publication QA summary,
- and, when needed, a revision plan.
Default workflow
0. Probe the environment and artifact state
Before generating anything, identify:
- whether
pubfig or pubtab is actually available,
- whether the user already has code / spreadsheets /
.tex / screenshots,
- 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 --json
python3 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
python3 scripts/ensure_publication_tooling.py --require ... as the default bundled route when the script is present,
- let that helper choose
uv vs python -m pip against the active interpreter,
- 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 pubfig
python3 scripts/ensure_publication_tooling.py --require pubtab
uv pip install pubfig
uv pip install pubtab
python -m pip install pubfig
python -m pip install pubtab
If auto-install fails, report the exact failure and then degrade gracefully.
Do not block on a full environment audit.
1. Classify the task
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.
Before plotting research results, lock the evidence contract:
- primary scientific claim,
- unit of analysis,
- primary metric and metric direction,
- whether repeated rows are independent,
- missing cells or incomplete comparison blocks,
- error-bar basis: subject, subject-task, fold, seed, run, or bootstrap sample,
- whether exact values need a companion table,
- whether the current evidence allows a winner/significance claim.
If these are unclear, ask or produce an audit recommendation instead of a polished figure. Do not create a paper-ready plot while the unit of analysis, missing-cell handling, or error-bar basis is unresolved.
2. Choose the representation
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.
3. Map to the toolchain
Default mapping:
- Figures →
pubfig
- Tables →
pubtab
- Mixed deliverables → use both, with each artifact carrying a distinct role
Tool roles:
pubfig is the default figure engine for scientific plots and paper-ready export.
pubtab is the default table engine for Excel ↔ LaTeX workflows, preview, and publication-ready table export.
- Figma/composite assembly is an optional secondary branch for multi-panel finishing.
Route selection rules:
- prefer Python for
pubfig figure generation,
- prefer CLI for
pubtab when the task is file-driven,
- prefer Python for
pubtab when the task is already inside a notebook or scripted pipeline,
- keep the figure and table responsibilities separate in mixed requests.
4. Generate concrete artifact instructions
Prefer the smallest production-ready artifact first:
- minimal runnable Python for
pubfig, or
- 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
pubfig call + one save_figure(...)
- multiple figure outputs:
batch_export(...)
- tables: one
pubtab xlsx2tex ... or pubtab.preview ...
- mixed requests: one figure route + one table route, clearly separated
5. Define the delivery contract
For every response, make these explicit when possible:
- the claim the artifact supports,
- which part is handled by
pubfig and which by pubtab,
- the output filenames,
- the output formats,
- whether the artifact is draft / final / revision,
- what still needs user-provided data or manuscript context.
6. Run publication QA
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
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 pubfig or pubtab is not available:
- do not fail immediately,
- first attempt automatic installation into the active environment,
- prefer
python3 scripts/ensure_publication_tooling.py --require ... when the bundled script exists,
- 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.
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.
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.
Recommended response shape
A strong response using this skill usually has 6 parts:
- Artifact decision — figure / table / paired deliverable, and why
- Tool route —
pubfig, pubtab, or both
- 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
Resources
Load these as needed:
references/workflow.md — full end-to-end decision order and delivery contract
references/chart-selection.md — task-to-chart mapping and anti-patterns
references/execution-and-verification.md — environment probing, forced install behavior, and runnable verification
scripts/ensure_publication_tooling.py — bundled probe + auto-install helper for pubfig / pubtab
references/pubfig-recipes.md — shortest useful figure patterns and export routes
references/pubtab-recipes.md — shortest useful table routes and backend guidance
references/source-guides/pubfig-architecture.md — package layout and figure-generation boundaries from source
references/source-guides/pubfig-api-map.md — stable public pubfig surface and chart-family map from __init__.py
references/source-guides/pubfig-export-flow.md — figure export, publication sizing, and panel-export flow from source
references/source-guides/pubtab-architecture.md — package layout and forward/reverse conversion architecture from source
references/source-guides/pubtab-cli-api-flow.md — CLI-to-API control flow and batch/sheet behavior from source
references/source-guides/pubtab-backend-and-preview.md — backend/theme split and real preview compile pipeline from source
references/publication-qa-checklist.md — figure/table QA checklist
references/composite-assembly.md — optional multi-panel and Figma branch
For prompt-shaped examples, see examples/.
1---2name: publication-chart-skill3description: This skill should be used when the user asks for a publication-quality scientific figure or table, wants help choosing the right chart for results, needs a paper-ready pubfig or pubtab workflow, wants a figure + companion table for a results section, wants an Excel sheet turned into publication-ready LaTeX, or wants an existing scientific figure/table reviewed and upgraded.4---5
6# Publication Chart Skill
7
8## Goal
9
10Use this skill to turn research results into **publication-grade figures and tables** with an end-to-end workflow.
11
12Primary production stack:
13
14- **`pubfig`** for figures
15- **`pubtab`** for publication tables
16
17This skill covers the full delivery chain:
18
191. understand the scientific communication goal,
202. choose the right artifact type,
213. map the task to `pubfig`, `pubtab`, or both,
224. generate concrete runnable instructions,
235. export paper-ready assets,
246. run publication QA,
257. propose targeted revisions.
26
27## Use this skill when
28
29Trigger this skill for requests like:
30
31- “make a publication-quality figure”
32- “choose the right chart for these results”
33- “turn these results into a paper-ready figure”
34- “make a benchmark / ablation / calibration / forest / heatmap / scatter / line / bar figure”
35- “make a benchmark / appendix / ablation table from Excel”
36- “convert this Excel table into publication-ready LaTeX”
37- “prepare one summary figure plus one companion table for the results section”
38- “review and improve this scientific figure/table”
39- “I already have a weak chart / screenshot / draft plot — make it publication-ready”
40- “export panels for a paper figure”
41
42## Do not use this skill for
43
44Do **not** use this skill when the task is mainly:
45
46- manuscript prose writing,
47- statistical testing without artifact design,
48- raw exploratory analysis with no publication deliverable,
49- Figma-first layout work before the figure/table content is solid.
50
51For simple composite assembly after the figure content is already strong, use the optional secondary workflow in `references/composite-assembly.md`.
52
53## Primary contract
54
55### Inputs
56
57Expect some combination of:
58
59- the scientific communication goal,
60- available data shape,
61- venue or style constraints,
62- whether the artifact is a figure, table, or mixed deliverable,
63- optional existing assets such as code, spreadsheets, `.tex`, screenshots, or draft plots,
64- whether the user needs a first draft, a publication-ready artifact, or a review/revision pass.
65
66### Outputs
67
68The minimum useful output is:
69
70- the recommended figure/table form,
71- the recommended `pubfig` / `pubtab` route,
72- a minimal runnable code snippet or CLI command,
73- explicit export filenames and formats,
74- a publication QA summary,
75- and, when needed, a revision plan.
76
77## Default workflow
78
79### 0. Probe the environment and artifact state
80
81Before generating anything, identify:
82
83- whether `pubfig` or `pubtab` is actually available,
84- whether the user already has code / spreadsheets / `.tex` / screenshots,
85- whether the deliverable is a fresh build or a revision,
86- whether the result needs exact values, fast visual perception, or both.
87
88Prefer the smallest environment check that helps execution. When the bundled helper script is available, use it first:
89
90- `python3 scripts/ensure_publication_tooling.py --require pubfig --json`
91- `python3 scripts/ensure_publication_tooling.py --require pubtab --json`
92
93Equivalent manual checks are still acceptable when needed:
94
95- `python -c "import pubfig; print(pubfig.__version__)"`
96- `python -c "import pubtab; print(pubtab.__version__)"`
97- `pubtab --help`
98
99Report the result clearly as **available** or **missing**.
100
101If a dependency is missing and the task requires runnable execution:
102
103- **auto-install it by default**,
104- prefer the user’s active environment instead of guessing a random global interpreter,
105- use `python3 scripts/ensure_publication_tooling.py --require ...` as the default bundled route when the script is present,
106- let that helper choose `uv` vs `python -m pip` against the active interpreter,
107- re-run the availability probe after installation,
108- and only then continue with the artifact workflow.
109
110Equivalent concrete commands include:
111
112- `python3 scripts/ensure_publication_tooling.py --require pubfig`
113- `python3 scripts/ensure_publication_tooling.py --require pubtab`
114- `uv pip install pubfig`
115- `uv pip install pubtab`
116- `python -m pip install pubfig`
117- `python -m pip install pubtab`
118
119If auto-install fails, report the exact failure and then degrade gracefully.
120
121Do not block on a full environment audit.
122
123### 1. Classify the task
124
125Classify the request along these axes:
126
127- **artifact type**: figure / table / mixed deliverable
128- **maturity**: exploratory draft / publication-ready generation / revision of an existing artifact
129- **structure**: single panel / multi-panel / figure-plus-table package
130- **evidence mode**: pattern perception / exact value lookup / both
131
132Do not jump into plotting code before the communication target is clear.
133
134Before plotting research results, lock the evidence contract:
135- primary scientific claim,
136- unit of analysis,
137- primary metric and metric direction,
138- whether repeated rows are independent,
139- missing cells or incomplete comparison blocks,
140- error-bar basis: subject, subject-task, fold, seed, run, or bootstrap sample,
141- whether exact values need a companion table,
142- whether the current evidence allows a winner/significance claim.
143
144If these are unclear, ask or produce an audit recommendation instead of a polished figure. Do not create a paper-ready plot while the unit of analysis, missing-cell handling, or error-bar basis is unresolved.
145
146### 2. Choose the representation
147
148Choose the representation based on the scientific claim, not novelty or visual flair.
149
150Common families:
151
152- **comparison** — grouped scatter, bar, line comparison, benchmark summary, companion table
153- **ablation** — grouped comparison, dumbbell, paired comparison, compact table
154- **distribution** — box, violin, raincloud, histogram, density, ECDF, QQ
155- **relationship** — scatter, bubble, contour2d, hexbin
156- **trend** — line, area
157- **evaluation / diagnostic** — calibration, ROC, PR, Bland–Altman, forest plot, volcano
158- **composition / hierarchy** — UpSet, stacked ratio, donut, radial hierarchy, circular grouped or stacked bars
159- **table** — benchmark table, ablation table, dataset summary, appendix table, error breakdown
160
161Avoid weak defaults:
162
163- avoid pie/donut when exact comparison matters and a bar/table is clearer,
164- avoid radar unless the comparison is genuinely profile-like and low-cardinality,
165- avoid 3D, decorative gradients, and dense legends used only for style,
166- avoid forcing every result into a figure when a publication table communicates the evidence better.
167
168If the request is ambiguous, explicitly state what scientific claim the artifact is supposed to support.
169
170### 3. Map to the toolchain
171
172Default mapping:
173
174- **Figures** → `pubfig`
175- **Tables** → `pubtab`
176- **Mixed deliverables** → use both, with each artifact carrying a distinct role
177
178Tool roles:
179
180- `pubfig` is the default figure engine for scientific plots and paper-ready export.
181- `pubtab` is the default table engine for Excel ↔ LaTeX workflows, preview, and publication-ready table export.
182- Figma/composite assembly is an **optional secondary branch** for multi-panel finishing.
183
184Route selection rules:
185
186- prefer **Python** for `pubfig` figure generation,
187- prefer **CLI** for `pubtab` when the task is file-driven,
188- prefer **Python** for `pubtab` when the task is already inside a notebook or scripted pipeline,
189- keep the figure and table responsibilities separate in mixed requests.
190
191### 4. Generate concrete artifact instructions
192
193Prefer the smallest production-ready artifact first:
194
195- minimal runnable Python for `pubfig`, or
196- minimal CLI/Python for `pubtab`
197
198Then add publication parameters only when justified:
199
200- labels, caption, width, export format, backend, preview, panel packaging, or composite layout.
201
202Keep filenames and suffixes explicit.
203
204Good defaults:
205
206- figures: one `pubfig` call + one `save_figure(...)`
207- multiple figure outputs: `batch_export(...)`
208- tables: one `pubtab xlsx2tex ...` or `pubtab.preview ...`
209- mixed requests: one figure route + one table route, clearly separated
210
211### 5. Define the delivery contract
212
213For every response, make these explicit when possible:
214
215- the claim the artifact supports,
216- which part is handled by `pubfig` and which by `pubtab`,
217- the output filenames,
218- the output formats,
219- whether the artifact is draft / final / revision,
220- what still needs user-provided data or manuscript context.
221
222### 6. Run publication QA
223
224After generation, check:
225
226- title and legend density,
227- axis labels and units,
228- category ordering and baseline clarity,
229- color accessibility and grayscale robustness,
230- font / line-weight consistency,
231- caption readiness,
232- figure/table readability after downscaling,
233- panel consistency for multi-panel figures,
234- venue-fit issues such as width, crowding, or over-annotation.
235
236The QA output must be concrete. Do not say “looks better” without naming why.
237
238### 7. Revise
239
240If the result is weak, revise with specific changes such as:
241
242- switch chart family,
243- remove chartjunk,
244- reorder categories,
245- move exact values into a table,
246- split a crowded panel,
247- add or simplify the caption,
248- change export width,
249- or convert the deliverable from figure-first to table-first.
250
251## Missing dependency behavior
252
253If `pubfig` or `pubtab` is not available:
254
255- do **not** fail immediately,
256- first attempt automatic installation into the active environment,
257- prefer `python3 scripts/ensure_publication_tooling.py --require ...` when the bundled script exists,
258- explicitly state which dependency is missing,
259- state which install command or helper route is being used,
260- re-check availability after installation,
261- if installation succeeds, continue with the runnable workflow,
262- if installation fails, degrade to a design/specification workflow,
263- provide pseudocode or draft commands,
264- preserve the recommended figure/table structure,
265- still provide QA and revision guidance.
266
267## Composite assembly rule
268
269Treat composite or Figma assembly as **secondary**:
270
271- use it when the user explicitly wants a multi-panel paper figure,
272- or when panel-level export and layout polishing are genuinely needed.
273
274Do not escalate simple figure tasks into composite/Figma workflows by default.
275
276## Output style rules
277
278- Prefer direct, implementation-usable outputs.
279- Explain the **why** of chart/table choice briefly, then give the runnable route.
280- When execution matters, include a short environment status block such as `pubfig: available/missing`, `pubtab: available/missing`.
281- If a dependency is missing, state the exact helper command or install command, perform the installation, and report the post-install status.
282- When a table is stronger than a figure, say so explicitly.
283- When a figure is stronger than a table, say so explicitly.
284- When both are needed, assign them different communication roles.
285- Keep revision guidance actionable and falsifiable.
286
287## Recommended response shape
288
289A strong response using this skill usually has 6 parts:
290
2911. **Artifact decision** — figure / table / paired deliverable, and why
2922. **Tool route** — `pubfig`, `pubtab`, or both
2933. **Minimal implementation** — runnable code or CLI
2944. **Export plan** — filenames, formats, width/backend/preview choices
2955. **Publication QA** — what to verify before paper submission
2966. **Revision plan** — what to change if the current artifact is weak
297
298## Resources
299
300Load these as needed:
301
302- `references/workflow.md` — full end-to-end decision order and delivery contract
303- `references/chart-selection.md` — task-to-chart mapping and anti-patterns
304- `references/execution-and-verification.md` — environment probing, forced install behavior, and runnable verification
305- `scripts/ensure_publication_tooling.py` — bundled probe + auto-install helper for `pubfig` / `pubtab`
306- `references/pubfig-recipes.md` — shortest useful figure patterns and export routes
307- `references/pubtab-recipes.md` — shortest useful table routes and backend guidance
308- `references/source-guides/pubfig-architecture.md` — package layout and figure-generation boundaries from source
309- `references/source-guides/pubfig-api-map.md` — stable public pubfig surface and chart-family map from `__init__.py`
310- `references/source-guides/pubfig-export-flow.md` — figure export, publication sizing, and panel-export flow from source
311- `references/source-guides/pubtab-architecture.md` — package layout and forward/reverse conversion architecture from source
312- `references/source-guides/pubtab-cli-api-flow.md` — CLI-to-API control flow and batch/sheet behavior from source
313- `references/source-guides/pubtab-backend-and-preview.md` — backend/theme split and real preview compile pipeline from source
314- `references/publication-qa-checklist.md` — figure/table QA checklist
315- `references/composite-assembly.md` — optional multi-panel and Figma branch
316
317For prompt-shaped examples, see `examples/`.