Create and audit truthful, accessible, publication-ready scientific figures with Matplotlib, Seaborn, or Plotly. Use for figure design, multi-panel layouts, uncertainty and missing-data displays, color/contrast review, image metadata validation, and journal export planning.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Create and audit truthful, accessible, publication-ready scientific figures with Matplotlib, Seaborn, or Plotly. Use for figure design, multi-panel layouts, uncertainty and missing-data displays, color/contrast review, image metadata validation, and journal export planning.
license
MIT
allowed-tools
Read Write Edit Bash Glob Grep
metadata
{"version":"1.1","skill-author":"K-Dense Inc.","compatibility":"Requires Python 3.11+ and uv; optional libraries depend on the requested figure format."}
Scientific Visualization
Build figures that preserve scientific meaning before optimizing appearance. Separate universal principles from dated publisher rules, preserve raw data and transformations, use color redundantly, and inspect delivered files rather than trusting plotting defaults.
Non-negotiable guardrails
Never alter, hide, invent, or selectively enhance data to improve a figure.
Preserve raw tables/images, exclusions, missing-value codes, analysis code, normalization, binning, image adjustments, and random seeds.
Do not infer journal requirements. Identify the exact journal, article type, figure type, and submission phase; verify its live official guidance.
Do not claim that a palette, DPI value, format, or automated report makes a figure accessible or journal-compliant.
Do not silently connect missing observations, suppress inconvenient points, upsample images as if detail increased, or tune axes/dual axes to exaggerate a conclusion.
Keep interactive and static outputs as distinct deliverables. Interactive hover is not a substitute for labels, alt text, keyboard access, an accessible data table, or a static fallback.
Read references/publication_guidelines.md for deceptive-encoding and integrity checks. Read references/journal_requirements.md only after the target and phase are known.
Workflow
1. Define the evidence and destination
Record:
audience and medium: manuscript, web, slide, poster, supplement;
exact publisher/journal, article type, submission phase, and intended final width;
source-data paths/identifiers and output provenance.
If requirements are not known, create a provisional general figure and label all publisher choices as pending verification.
2. Choose an honest encoding
Prefer position on a common scale. Before coding, check:
Bars/areas: normally include zero because length/area is measured from a baseline.
Points/lines: nonzero limits can be valid; show context and disclose breaks.
Uncertainty: name SD, SE, CI, percentile, posterior, or another interval; state n and the unit of replication.
Raw observations: show them when feasible; do not let jitter obscure categories/values.
Missing data: distinguish missing, zero, censored, and excluded; use gaps or explicit model/interpolation styling.
Area/volume: scale area/volume, not radius/diameter; avoid decorative 3D.
Log axes: label the base/transform and declare how zero/negative values are handled.
Binning/smoothing: record edges, bandwidth/window, method, and sensitivity.
Normalization: state formula/reference and keep limits consistent across compared panels.
Dual axes: prefer aligned panels; if unavoidable, justify units and do not engineer apparent correlation.
Images: preserve originals, disclose whole-image adjustments, show scale bars, and avoid clipped/erased background.
3. Design accessibility in, not after
Use color plus marker, line style, hatching, direct label, or panel separation.
Choose qualitative, sequential, diverging, or cyclic color according to data semantics.
Audit foreground/background contrast at the rendered size.
Make missing and out-of-range values explicit.
Provide alt text, a longer description for complex figures, and underlying data for web delivery.
Treat WCAG 2.2 as web guidance: 4.5:1 normal text, 3:1 large text, and 3:1 for graphical objects required for understanding; color cannot be the only cue. Applicability and exceptions matter.
See references/color_palettes.md. A grayscale screen is useful but is not a complete color-vision or accessibility test.
4. Implement with scoped styles
Use Matplotlib's object-oriented API and temporary style contexts:
import matplotlib.pyplot as plt
from style_presets import style_context
with style_context("default", palette_name="okabe_ito_on_white"):
fig, ax = plt.subplots(
figsize=(89 / 25.4, 60 / 25.4),
layout="constrained",
)
ax.plot(x, y, marker="o", label="Observed")
ax.set(xlabel="Time (hours)", ylabel="Response (unit)")
ax.legend()
layout="constrained" supports colorbars, nested GridSpec, subfigures, and subplot_mosaic. Do not call tight_layout() afterward; it disables constrained layout.
For exact physical dimensions, do not use bbox_inches="tight" unless the changed page size is intentional.
Axes-level functions fit custom Matplotlib layouts; figure-level functions create their own figures/facets. Do not customize Seaborn's internal artist lists as if they were stable API.
Plotly
Use write_html() for interaction and write_image()/plotly.io.write_images() for static output.
Kaleido 1.3.0 requires Chrome/Chromium; it no longer bundles Chrome.
Current static formats: PNG, JPEG, WebP, SVG, PDF. EPS is Kaleido v0-only.
Do not pass deprecated engine= or use Orca/plotly.io.kaleido.scope.
width, height, and scale control pixels; scale=3 is not inherently “300 DPI.”
WebGL traces embed raster content in PDF/SVG.
Fully offline exports need local external assets when a figure references MathJax/topojson/tiles.
The exporter refuses implicit overwrite, writes atomically, keeps vector DPI for embedded rasters, uses TIFF LZW, and can use PDF/PS Type 42 fonts. It does not validate scientific content or publisher acceptance.
For editable fonts:
PDF/PS Type 42 embeds TrueType fonts.
svg.fonttype="none" keeps text editable/searchable but does not embed fonts; appearance depends on installed fonts.
svg.fonttype="path" preserves glyph appearance as paths but loses editable/searchable text.
Use an opaque explicit background unless transparency is required; blending against another background changes apparent contrast.
6. Inspect, compare, and review
Inspect file metadata.
Audit palette contrast/grayscale separation.
Compare against a dated publisher snapshot.
View at final size in the manuscript/web context.
Manually review fonts, embedded rasters, clipping, legends, scale bars, image integrity, caption, alt text, and source data.
Re-check the live target-journal page immediately before upload.
Pinned snapshot
The examples and smoke tests use direct package pins current on 2026-07-23:
This is a dated direct-dependency snapshot, not a transitive lock. Use the project's uv lock for exact replay; this skill intentionally ships no dependency lock.
Bundled CLIs
All helpers are deterministic, network-free, bounded, reject symlink inputs/destinations where relevant, and refuse overwrite unless --force is explicit.
Supports raster images (Pillow), SVG, PDF (pypdf), and EPS/PS. Reports dimensions, DPI/effective DPI, mode, alpha, ICC presence, compression, page size, and conservative first-page PDF font resources. It does not inspect every embedded raster in a vector container.