name: ieee-figure
description: >-
Submission-grade IEEE figure workflow for Python or R. Use whenever the user
asks to create, revise, audit, or polish manuscript figures, multi-panel
scientific plots, engineering plots, figures4papers-style matplotlib plots,
or journal/conference-ready EPS/PDF/PNG/TIFF outputs for IEEE journals,
IEEE conferences, Transactions, Letters, or similar engineering venues.
Before plotting, define the figure's conclusion, evidence logic, column width,
export needs, grayscale/print risks, and review risks. If the user has not
chosen Python or R, ask "Python or R?" and stop. Use only the selected backend
for figure generation, previewing, exporting, and QA. Supports
matplotlib/seaborn and ggplot2/patchwork/ComplexHeatmap. Not for dashboards
or Illustrator/Figma-first infographics.
IEEE Figure Making Skill
A guide for producing IEEE-ready scientific and engineering figures as clear
visual evidence, not isolated decorative plots. Every figure starts from a claim,
an evidence hierarchy, the target IEEE column width, and an export/print check
before code or aesthetics.
The older Python/matplotlib rules in this skill remain valid. The skill also
supports R, especially ggplot2 + patchwork + ComplexHeatmap + ggrepel + svglite/cairo_pdf + ragg. If the user provides a private plotting template
collection, use it only as an internal adaptation source and do not reveal its
path, filenames, or provenance in user-facing output.
Color policy: prefer clear engineering contrast and grayscale-safe encodings.
Do not rely on color alone; pair color with line style, marker shape, direct
labels, outlines, or ordered luminance when the figure may be printed in black
and white. Do not use interior textures/hatching by default; use them only
when the user explicitly asks or when grayscale distinctions cannot be made by
cleaner encodings.
First move: figure contract before plotting
Before generating or editing code, establish the contract below.
Backend selection is a blocking gate. If the user has not explicitly chosen
Python or R in the current request or provided a clearly language-specific input
file/workflow, ask one concise question: Python or R? Then stop and wait for
the user's answer. Do not generate mock data, write scripts, create figures, or
choose Python/R by default. This overrides general autonomy/default-execution
behavior for figure tasks.
The selected backend is exclusive for all figure generation. Once Python or
R is selected, every plotting script, preview image, EPS/PDF/SVG/TIFF/PNG export,
QA render, and visual workaround must be produced by that same backend. Do not
use Python to draw a preview for an R figure, and do not use R to draw a preview
for a Python figure, even if the selected runtime or packages are missing locally.
The non-selected language may only be used for non-visual file inspection or data
conversion when it does not open a graphics device, import plotting libraries,
create image/vector files, or change the final visual appearance.
Missing runtime/package rule. After the backend is selected, check the
selected runtime early (Rscript/R for R; Python and required plotting packages
for Python). If the selected runtime or required packages are unavailable, stop
before rendering and report the exact blocker. You may provide a selected-backend
script and installation commands, or ask permission to install dependencies, but
you must not fall back to the other language to make a substitute figure.
Only recommend a backend when the user explicitly asks you to choose or recommend
one. In that case, use references/backend-selection.md, state the reason, and
then proceed with the recommended backend.
- Core conclusion: write the one-sentence claim the figure must defend.
- Evidence chain: map each planned panel to the claim, and drop panels that do
not carry a unique piece of evidence.
- Archetype: classify the figure as
quantitative grid,
schematic-led engineering composite, image/field map + quant, or
asymmetric mixed-modality figure.
- Backend: use the selected Python or R track exclusively for all figure drawing,
previewing, exporting, and visual QA. Do not cross-render with the other
language.
- IEEE/export contract: set destination type, final column width, readable text
after reduction, vector/raster boundary, source data, statistics, grayscale
safety, accepted file formats, font handling, and export names before styling.
The highest-priority rule is: the chart serves the technical argument.
Aesthetic polish, template matching, and complex layout are subordinate to making
the core conclusion clear, defensible, reproducible, and readable at IEEE column
width.
IEEE defaults
- Single-column width:
3.5 in / 88.9 mm.
- Half-column inset: use when explicitly requested for a compact plot, framework,
architecture, circuit, module, or flow diagram occupying a small manuscript
region. Default starts are
1.7 x 1.7 in, with target width:height = 1:1.
For plotted figures, keep the axes box/line frame approximately square as well.
- Double-column width:
7.16 in / 182 mm.
- Maximum ordinary submitted graphic size before compression checks:
7.16 x 8.8 in / 182 x 220 mm.
- Use the target column width from the destination template if it is supplied.
- Do not prepare graphics below one-column width unless the user explicitly asks
for a half-column inset/block diagram or provides a template slot. In that case,
keep the normal font size and simplify geometry instead of shrinking text.
- Prefer vector output for line art and plots:
PS, EPS, or PDF; SVG is
useful as an editable intermediate when the workflow supports it.
- Use
PNG or TIFF for raster-heavy field maps, photos, microscopy, simulation
heatmaps, and previews.
- Resolution: color/grayscale raster at least
300 dpi; black-and-white line art
at least 600 dpi.
- Text: IEEE-listed fonts include Helvetica, Times New Roman, Arial, Cambria, and
Symbol. Type should appear about
9-10 pt at full size; use 8 pt only as a
compact lower bound for dense labels that remain legible.
- Font handling: for
EPS, PS, or PDF, embed fonts or convert text to
outlines; prefer embedding for editable source files.
- Multi-panel labels: IEEE commonly uses
(a), (b), (c); keep labels
consistent, visible, and close to their panels.
- File naming: for final exports, use the first five letters of the primary
author's surname plus figure number when known, such as
gonza1.pdf; otherwise
use clear sequential names and flag naming as a final-submission item.
- Avoid unaccepted formats: VSD, GIF, BMP, and manuscript JPEG. High-resolution
JPEG is only for author photos.
- Color: ensure grayscale print remains interpretable. Use line styles, markers,
clean luminance contrast, outlines, and direct labels in addition to color.
Avoid texture/hatching inside bars or filled regions unless explicitly requested.
- Axes: include units, define error bars, and align scales when panels invite
comparison.
- Scientific notation: render subscripts/superscripts with math text or the
selected backend's expression system. Never leave labels like
P_on, R_th,
V_g, I_d, or t_rise as raw underscore text in the final figure.
- Captions must define symbols, abbreviations, colors, line styles, and markers.
- Reused or adapted graphics need permission and citation notes.
- Do not use the Lena image in submitted IEEE figures.
Half-column inset and compact block diagrams
Use this mode when the user asks for a half-column figure, compact framework,
architecture block, module diagram, circuit/data-flow schematic, or a figure that
occupies a true half-column inset slot.
- Keep font size unchanged: target
9-10 pt full-size type, with 8 pt only for
dense but still readable labels.
- Keep a deliberate aspect ratio. If the user specifies only width, choose height
equal to width for half-column inset figures. For plotted figures, keep the
axes box/line frame approximately
1:1, not just the outer canvas.
- Prefer fewer blocks and stronger hierarchy over shrinking the entire drawing.
- Use abbreviations only when the caption defines them.
- Use direct labels inside blocks when possible.
- If a legend is needed, place it intelligently in unused white space:
top-right, top-left, bottom-right, bottom-left, then outside-above/outside-below
as fallbacks.
- Do not let the legend cover arrows, nodes, data, axis labels, scale bars, or the
visual path of the schematic.
- For block diagrams, reserve a small "legend bay" or empty corner during layout
instead of adding the legend after the diagram is crowded.
User-facing privacy rule
Do not disclose private local paths, private filenames, chat-attachment names,
internal reference filenames, template identifiers, or the provenance of private
working materials in user-facing replies, generated code comments, figure legends,
reports, or manuscript text. Use generic descriptions such as "the provided R
template collection", "a private working draft", or "the internal figure contract".
Only reveal an exact path or source file when the user explicitly asks for that
audit trail.
Python quick-start
Python-only execution rule. When the user has selected Python, do all figure
drawing, previewing, exporting, and visual QA in Python. Do not call R/ggplot2,
ComplexHeatmap, patchwork, or any R graphics device to create a temporary preview,
fallback export, or layout approximation. If Python or required Python plotting
packages are missing, stop before rendering and report the missing dependency.
You may still write the Python script, provide pip/environment install commands,
or ask permission to install dependencies, but do not cross-render the figure in R.
import matplotlib as mpl
import matplotlib.pyplot as plt
IEEE_SINGLE_COLUMN_IN = 3.5
IEEE_DOUBLE_COLUMN_IN = 7.16
mpl.rcParams.update({
"font.family": "sans-serif",
"font.sans-serif": ["Arial", "Helvetica", "DejaVu Sans", "sans-serif"],
"svg.fonttype": "none", # editable text in SVG
"pdf.fonttype": 42, # editable TrueType text in PDF
"ps.fonttype": 42, # editable TrueType text in EPS/PS when supported
"font.size": 9,
"axes.spines.left": True,
"axes.spines.right": True,
"axes.spines.bottom": True,
"axes.spines.top": True,
"axes.linewidth": 0.8,
"axes.grid": False,
"xtick.direction": "in",
"ytick.direction": "in",
"xtick.top": True,
"ytick.right": True,
"xtick.major.width": 0.8,
"ytick.major.width": 0.8,
"lines.linewidth": 1.0,
"legend.frameon": False,
})
def save_ieee_py(fig, filename, dpi=600):
fig.savefig(f"{filename}.pdf", bbox_inches="tight")
fig.savefig(f"{filename}.eps", bbox_inches="tight")
fig.savefig(f"{filename}.png", dpi=300, bbox_inches="tight")
fig.savefig(f"{filename}.tiff", dpi=dpi, bbox_inches="tight")
Use text.usetex = True only when LaTeX is installed and math-rich labels are
required by the paper.
R quick-start
library(ggplot2)
library(patchwork)
IEEE_SINGLE_COLUMN_IN <- 3.5
IEEE_DOUBLE_COLUMN_IN <- 7.16
theme_set(
theme_bw(base_size = 9, base_family = "Arial") +
theme(
panel.border = element_rect(linewidth = 0.35, colour = "black", fill = NA),
axis.line = element_blank(),
axis.ticks = element_line(linewidth = 0.35, colour = "black"),
axis.ticks.length = grid::unit(-1.5, "pt"),
legend.title = element_text(size = 9),
legend.text = element_text(size = 8),
strip.text = element_text(size = 9, face = "bold"),
plot.title = element_text(size = 9.5, face = "bold"),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank()
)
)
save_ieee_r <- function(plot, filename, width_in = IEEE_SINGLE_COLUMN_IN,
height_in = 2.6, dpi = 600) {
grDevices::cairo_pdf(paste0(filename, ".pdf"), width = width_in,
height = height_in, family = "Arial")
print(plot)
dev.off()
grDevices::postscript(paste0(filename, ".eps"), width = width_in,
height = height_in, family = "Arial",
horizontal = FALSE, paper = "special")
print(plot)
dev.off()
ragg::agg_png(paste0(filename, ".png"), width = width_in, height = height_in,
units = "in", res = 300)
print(plot)
dev.off()
ragg::agg_tiff(paste0(filename, ".tiff"), width = width_in, height = height_in,
units = "in", res = dpi)
print(plot)
dev.off()
}
Default operating stance
- Start by classifying the requested figure into one of five archetypes:
quantitative grid, schematic-led engineering composite,
half-column block diagram, image/field map + quant, or
asymmetric mixed-modality figure.
- If the user asks for a single chart, still identify its role in the manuscript
claim: architecture, mechanism, validation, comparison, robustness, ablation,
sensitivity, or deployment relevance.
- Prefer compact, readable panels over page-filling visual drama; IEEE figures
often need to survive aggressive single-column reduction.
- Keep the background white for plots and diagrams; switch to black only for
microscopy, thermal/field-map image plates, or volume-rendering panels where
that is the native visual convention.
- Prefer direct labels over legends when categories are spatially fixed or the
legend would force unnecessary eye travel.
- Keep one restrained palette per figure and add non-color encodings for print:
line style, marker shape, ordered lightness, outlines, or annotations. Avoid
hatched/textured fills unless the user asks for them.
- Treat statistics,
n, error-bar definitions, source-data traceability, axis
units, caption definitions, permission status, font embedding, file naming, and
grayscale-readability notes as part of the figure, not as optional cleanup.
- When the user asks for IEEE-specific compliance, read
references/ieee-figure-guidelines.md before choosing dimensions and exports.
- When the user references
figures4papers or the older
scientific-figure-making skill, treat this skill as the IEEE-adapted successor
and open references/demos.md for bundled Python demo scripts.
When to load this skill
- Python or R figures for papers, slides, or reports targeting IEEE journals,
IEEE conferences, Transactions, Letters, or similar engineering venues.
- Requests involving grouped bars, trend lines, heatmaps, radar plots,
multi-panel grids, simulation maps, device plots, ablations, comparisons, or
PDF/EPS/PNG/TIFF/high-DPI output.
- Any mention of "IEEE style", "IEEE figure", "publication figure", "paper
figure", "SCI figure", "figures4papers", "scientific-figure-making",
"R plotting template", or "high-quality scientific plot".
- Requests to improve a figure's logic, aesthetics, panel layout, figure legend,
export quality, grayscale safety, or journal-readiness.
When NOT to load
- Plotly, Altair, Bokeh, or other interactive/web-first plotting.
- EDA-only plots without a publication target.
- Primary workflow is 3D, GIS, or non-scientific illustration tooling.
- Illustrator / Figma-first layout.
Related files
| File |
Open when |
| references/figure-contract.md |
Need to convert a user request into core conclusion, evidence hierarchy, panel map, and review-risk checks |
| references/ieee-figure-guidelines.md |
Need IEEE dimensions, export formats, resolution, font, panel-label, and grayscale rules |
| references/backend-selection.md |
User has not chosen Python/R, asks for a recommendation, or a mixed Python/R workflow is possible |
| references/r-workflow.md |
User chooses R or provides R scripts/templates/data |
| references/r-template-index.md |
Need to adapt a user-provided or private R template collection without exposing source paths |
| references/qa-contract.md |
Before final delivery, revision package, microscopy/blot figure, or journal-specific audit |
| references/design-theory.md |
Typography, color theory, layout rationale, export policy |
| references/api.md |
Python PALETTE, helper function signatures, validation rules |
| references/common-patterns.md |
Python layout patterns: compact comparison panels, legend-only axes, image plates, asymmetric layouts |
| references/tutorials.md |
End-to-end walkthroughs: bars, trends, heatmaps |
| references/chart-types.md |
Radar, 3D sphere, fill_between, scatter patterns |
| references/demos.md |
Bundled figures4papers Python scripts and output previews for concrete pattern adaptation |
1---2name: ieee-figure3description: Submission-grade IEEE figure workflow for Python or R. Use whenever the user asks to create, revise, audit, or polish manuscript figures, multi-panel scientific4---5---6name: ieee-figure7description: >-8 Submission-grade IEEE figure workflow for Python or R. Use whenever the user9 asks to create, revise, audit, or polish manuscript figures, multi-panel10 scientific plots, engineering plots, figures4papers-style matplotlib plots,11 or journal/conference-ready EPS/PDF/PNG/TIFF outputs for IEEE journals,12 IEEE conferences, Transactions, Letters, or similar engineering venues.13 Before plotting, define the figure's conclusion, evidence logic, column width,14 export needs, grayscale/print risks, and review risks. If the user has not15 chosen Python or R, ask "Python or R?" and stop. Use only the selected backend16 for figure generation, previewing, exporting, and QA. Supports17 matplotlib/seaborn and ggplot2/patchwork/ComplexHeatmap. Not for dashboards18 or Illustrator/Figma-first infographics.19---2021# IEEE Figure Making Skill2223A guide for producing IEEE-ready scientific and engineering figures as clear24visual evidence, not isolated decorative plots. Every figure starts from a claim,25an evidence hierarchy, the target IEEE column width, and an export/print check26before code or aesthetics.2728The older Python/matplotlib rules in this skill remain valid. The skill also29supports R, especially `ggplot2 + patchwork + ComplexHeatmap + ggrepel +30svglite/cairo_pdf + ragg`. If the user provides a private plotting template31collection, use it only as an internal adaptation source and do not reveal its32path, filenames, or provenance in user-facing output.3334Color policy: prefer clear engineering contrast and grayscale-safe encodings.35Do not rely on color alone; pair color with line style, marker shape, direct36labels, outlines, or ordered luminance when the figure may be printed in black37and white. Do **not** use interior textures/hatching by default; use them only38when the user explicitly asks or when grayscale distinctions cannot be made by39cleaner encodings.4041## First move: figure contract before plotting4243Before generating or editing code, establish the contract below.4445**Backend selection is a blocking gate.** If the user has not explicitly chosen46Python or R in the current request or provided a clearly language-specific input47file/workflow, ask one concise question: **Python or R?** Then stop and wait for48the user's answer. Do not generate mock data, write scripts, create figures, or49choose Python/R by default. This overrides general autonomy/default-execution50behavior for figure tasks.5152**The selected backend is exclusive for all figure generation.** Once Python or53R is selected, every plotting script, preview image, EPS/PDF/SVG/TIFF/PNG export,54QA render, and visual workaround must be produced by that same backend. Do not55use Python to draw a preview for an R figure, and do not use R to draw a preview56for a Python figure, even if the selected runtime or packages are missing locally.57The non-selected language may only be used for non-visual file inspection or data58conversion when it does not open a graphics device, import plotting libraries,59create image/vector files, or change the final visual appearance.6061**Missing runtime/package rule.** After the backend is selected, check the62selected runtime early (`Rscript`/R for R; Python and required plotting packages63for Python). If the selected runtime or required packages are unavailable, stop64before rendering and report the exact blocker. You may provide a selected-backend65script and installation commands, or ask permission to install dependencies, but66you must not fall back to the other language to make a substitute figure.6768Only recommend a backend when the user explicitly asks you to choose or recommend69one. In that case, use `references/backend-selection.md`, state the reason, and70then proceed with the recommended backend.71721. Core conclusion: write the one-sentence claim the figure must defend.732. Evidence chain: map each planned panel to the claim, and drop panels that do74 not carry a unique piece of evidence.753. Archetype: classify the figure as `quantitative grid`,76 `schematic-led engineering composite`, `image/field map + quant`, or77 `asymmetric mixed-modality figure`.784. Backend: use the selected Python or R track exclusively for all figure drawing,79 previewing, exporting, and visual QA. Do not cross-render with the other80 language.815. IEEE/export contract: set destination type, final column width, readable text82 after reduction, vector/raster boundary, source data, statistics, grayscale83 safety, accepted file formats, font handling, and export names before styling.8485The highest-priority rule is: **the chart serves the technical argument**.86Aesthetic polish, template matching, and complex layout are subordinate to making87the core conclusion clear, defensible, reproducible, and readable at IEEE column88width.8990## IEEE defaults9192- Single-column width: `3.5 in` / `88.9 mm`.93- Half-column inset: use when explicitly requested for a compact plot, framework,94 architecture, circuit, module, or flow diagram occupying a small manuscript95 region. Default starts are `1.7 x 1.7 in`, with target `width:height = 1:1`.96 For plotted figures, keep the axes box/line frame approximately square as well.97- Double-column width: `7.16 in` / `182 mm`.98- Maximum ordinary submitted graphic size before compression checks:99 `7.16 x 8.8 in` / `182 x 220 mm`.100- Use the target column width from the destination template if it is supplied.101- Do not prepare graphics below one-column width unless the user explicitly asks102 for a half-column inset/block diagram or provides a template slot. In that case,103 keep the normal font size and simplify geometry instead of shrinking text.104- Prefer vector output for line art and plots: `PS`, `EPS`, or `PDF`; `SVG` is105 useful as an editable intermediate when the workflow supports it.106- Use `PNG` or `TIFF` for raster-heavy field maps, photos, microscopy, simulation107 heatmaps, and previews.108- Resolution: color/grayscale raster at least `300 dpi`; black-and-white line art109 at least `600 dpi`.110- Text: IEEE-listed fonts include Helvetica, Times New Roman, Arial, Cambria, and111 Symbol. Type should appear about `9-10 pt` at full size; use `8 pt` only as a112 compact lower bound for dense labels that remain legible.113- Font handling: for `EPS`, `PS`, or `PDF`, embed fonts or convert text to114 outlines; prefer embedding for editable source files.115- Multi-panel labels: IEEE commonly uses `(a)`, `(b)`, `(c)`; keep labels116 consistent, visible, and close to their panels.117- File naming: for final exports, use the first five letters of the primary118 author's surname plus figure number when known, such as `gonza1.pdf`; otherwise119 use clear sequential names and flag naming as a final-submission item.120- Avoid unaccepted formats: VSD, GIF, BMP, and manuscript JPEG. High-resolution121 JPEG is only for author photos.122- Color: ensure grayscale print remains interpretable. Use line styles, markers,123 clean luminance contrast, outlines, and direct labels in addition to color.124 Avoid texture/hatching inside bars or filled regions unless explicitly requested.125- Axes: include units, define error bars, and align scales when panels invite126 comparison.127- Scientific notation: render subscripts/superscripts with math text or the128 selected backend's expression system. Never leave labels like `P_on`, `R_th`,129 `V_g`, `I_d`, or `t_rise` as raw underscore text in the final figure.130- Captions must define symbols, abbreviations, colors, line styles, and markers.131- Reused or adapted graphics need permission and citation notes.132- Do not use the Lena image in submitted IEEE figures.133134## Half-column inset and compact block diagrams135136Use this mode when the user asks for a half-column figure, compact framework,137architecture block, module diagram, circuit/data-flow schematic, or a figure that138occupies a true half-column inset slot.139140- Keep font size unchanged: target `9-10 pt` full-size type, with `8 pt` only for141 dense but still readable labels.142- Keep a deliberate aspect ratio. If the user specifies only width, choose height143 equal to width for half-column inset figures. For plotted figures, keep the144 axes box/line frame approximately `1:1`, not just the outer canvas.145- Prefer fewer blocks and stronger hierarchy over shrinking the entire drawing.146- Use abbreviations only when the caption defines them.147- Use direct labels inside blocks when possible.148- If a legend is needed, place it intelligently in unused white space:149 top-right, top-left, bottom-right, bottom-left, then outside-above/outside-below150 as fallbacks.151- Do not let the legend cover arrows, nodes, data, axis labels, scale bars, or the152 visual path of the schematic.153- For block diagrams, reserve a small "legend bay" or empty corner during layout154 instead of adding the legend after the diagram is crowded.155156## User-facing privacy rule157158Do not disclose private local paths, private filenames, chat-attachment names,159internal reference filenames, template identifiers, or the provenance of private160working materials in user-facing replies, generated code comments, figure legends,161reports, or manuscript text. Use generic descriptions such as "the provided R162template collection", "a private working draft", or "the internal figure contract".163Only reveal an exact path or source file when the user explicitly asks for that164audit trail.165166## Python quick-start167168**Python-only execution rule.** When the user has selected Python, do all figure169drawing, previewing, exporting, and visual QA in Python. Do not call R/ggplot2,170ComplexHeatmap, patchwork, or any R graphics device to create a temporary preview,171fallback export, or layout approximation. If Python or required Python plotting172packages are missing, stop before rendering and report the missing dependency.173You may still write the Python script, provide `pip`/environment install commands,174or ask permission to install dependencies, but do not cross-render the figure in R.175176```python177import matplotlib as mpl178import matplotlib.pyplot as plt179180IEEE_SINGLE_COLUMN_IN = 3.5181IEEE_DOUBLE_COLUMN_IN = 7.16182183mpl.rcParams.update({184 "font.family": "sans-serif",185 "font.sans-serif": ["Arial", "Helvetica", "DejaVu Sans", "sans-serif"],186 "svg.fonttype": "none", # editable text in SVG187 "pdf.fonttype": 42, # editable TrueType text in PDF188 "ps.fonttype": 42, # editable TrueType text in EPS/PS when supported189 "font.size": 9,190 "axes.spines.left": True,191 "axes.spines.right": True,192 "axes.spines.bottom": True,193 "axes.spines.top": True,194 "axes.linewidth": 0.8,195 "axes.grid": False,196 "xtick.direction": "in",197 "ytick.direction": "in",198 "xtick.top": True,199 "ytick.right": True,200 "xtick.major.width": 0.8,201 "ytick.major.width": 0.8,202 "lines.linewidth": 1.0,203 "legend.frameon": False,204})205206def save_ieee_py(fig, filename, dpi=600):207 fig.savefig(f"{filename}.pdf", bbox_inches="tight")208 fig.savefig(f"{filename}.eps", bbox_inches="tight")209 fig.savefig(f"{filename}.png", dpi=300, bbox_inches="tight")210 fig.savefig(f"{filename}.tiff", dpi=dpi, bbox_inches="tight")211```212213Use `text.usetex = True` only when LaTeX is installed and math-rich labels are214required by the paper.215216## R quick-start217218```r219library(ggplot2)220library(patchwork)221222IEEE_SINGLE_COLUMN_IN <- 3.5223IEEE_DOUBLE_COLUMN_IN <- 7.16224225theme_set(226 theme_bw(base_size = 9, base_family = "Arial") +227 theme(228 panel.border = element_rect(linewidth = 0.35, colour = "black", fill = NA),229 axis.line = element_blank(),230 axis.ticks = element_line(linewidth = 0.35, colour = "black"),231 axis.ticks.length = grid::unit(-1.5, "pt"),232 legend.title = element_text(size = 9),233 legend.text = element_text(size = 8),234 strip.text = element_text(size = 9, face = "bold"),235 plot.title = element_text(size = 9.5, face = "bold"),236 panel.grid.major = element_blank(),237 panel.grid.minor = element_blank()238 )239)240241save_ieee_r <- function(plot, filename, width_in = IEEE_SINGLE_COLUMN_IN,242 height_in = 2.6, dpi = 600) {243 grDevices::cairo_pdf(paste0(filename, ".pdf"), width = width_in,244 height = height_in, family = "Arial")245 print(plot)246 dev.off()247 grDevices::postscript(paste0(filename, ".eps"), width = width_in,248 height = height_in, family = "Arial",249 horizontal = FALSE, onefile = FALSE, paper = "special")250 print(plot)251 dev.off()252 ragg::agg_png(paste0(filename, ".png"), width = width_in, height = height_in,253 units = "in", res = 300)254 print(plot)255 dev.off()256 ragg::agg_tiff(paste0(filename, ".tiff"), width = width_in, height = height_in,257 units = "in", res = dpi)258 print(plot)259 dev.off()260}261```262263## Default operating stance264265- Start by classifying the requested figure into one of five archetypes:266 `quantitative grid`, `schematic-led engineering composite`,267 `half-column block diagram`, `image/field map + quant`, or268 `asymmetric mixed-modality figure`.269- If the user asks for a single chart, still identify its role in the manuscript270 claim: architecture, mechanism, validation, comparison, robustness, ablation,271 sensitivity, or deployment relevance.272- Prefer compact, readable panels over page-filling visual drama; IEEE figures273 often need to survive aggressive single-column reduction.274- Keep the background white for plots and diagrams; switch to black only for275 microscopy, thermal/field-map image plates, or volume-rendering panels where276 that is the native visual convention.277- Prefer direct labels over legends when categories are spatially fixed or the278 legend would force unnecessary eye travel.279- Keep one restrained palette per figure and add non-color encodings for print:280 line style, marker shape, ordered lightness, outlines, or annotations. Avoid281 hatched/textured fills unless the user asks for them.282- Treat statistics, `n`, error-bar definitions, source-data traceability, axis283 units, caption definitions, permission status, font embedding, file naming, and284 grayscale-readability notes as part of the figure, not as optional cleanup.285- When the user asks for IEEE-specific compliance, read286 `references/ieee-figure-guidelines.md` before choosing dimensions and exports.287- When the user references `figures4papers` or the older288 `scientific-figure-making` skill, treat this skill as the IEEE-adapted successor289 and open `references/demos.md` for bundled Python demo scripts.290291## When to load this skill292293- Python or R figures for **papers, slides, or reports** targeting IEEE journals,294 IEEE conferences, Transactions, Letters, or similar engineering venues.295- Requests involving **grouped bars, trend lines, heatmaps, radar plots,296 multi-panel grids, simulation maps, device plots, ablations, comparisons**, or297 **PDF/EPS/PNG/TIFF/high-DPI** output.298- Any mention of "IEEE style", "IEEE figure", "publication figure", "paper299 figure", "SCI figure", "figures4papers", "scientific-figure-making",300 "R plotting template", or "high-quality scientific plot".301- Requests to improve a figure's logic, aesthetics, panel layout, figure legend,302 export quality, grayscale safety, or journal-readiness.303304## When NOT to load305306- Plotly, Altair, Bokeh, or other interactive/web-first plotting.307- EDA-only plots without a publication target.308- Primary workflow is 3D, GIS, or non-scientific illustration tooling.309- Illustrator / Figma-first layout.310311## Related files312313| File | Open when |314|------|-----------|315| [references/figure-contract.md](references/figure-contract.md) | Need to convert a user request into core conclusion, evidence hierarchy, panel map, and review-risk checks |316| [references/ieee-figure-guidelines.md](references/ieee-figure-guidelines.md) | Need IEEE dimensions, export formats, resolution, font, panel-label, and grayscale rules |317| [references/backend-selection.md](references/backend-selection.md) | User has not chosen Python/R, asks for a recommendation, or a mixed Python/R workflow is possible |318| [references/r-workflow.md](references/r-workflow.md) | User chooses R or provides R scripts/templates/data |319| [references/r-template-index.md](references/r-template-index.md) | Need to adapt a user-provided or private R template collection without exposing source paths |320| [references/qa-contract.md](references/qa-contract.md) | Before final delivery, revision package, microscopy/blot figure, or journal-specific audit |321| [references/design-theory.md](references/design-theory.md) | Typography, color theory, layout rationale, export policy |322| [references/api.md](references/api.md) | Python PALETTE, helper function signatures, validation rules |323| [references/common-patterns.md](references/common-patterns.md) | Python layout patterns: compact comparison panels, legend-only axes, image plates, asymmetric layouts |324| [references/tutorials.md](references/tutorials.md) | End-to-end walkthroughs: bars, trends, heatmaps |325| [references/chart-types.md](references/chart-types.md) | Radar, 3D sphere, fill_between, scatter patterns |326| [references/demos.md](references/demos.md) | Bundled figures4papers Python scripts and output previews for concrete pattern adaptation |