Meta-skill for publication-ready figures. Use when creating journal submission figures requiring multi-panel layouts, significance annotations, error bars, colorblind-safe palettes, and specific journal formatting (Nature, Science, Cell). Orchestrates matplotlib/seaborn/plotly with publication styles. For quick exploration use seaborn or plotly directly.
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.
Meta-skill for publication-ready figures. Use when creating journal submission figures requiring multi-panel layouts, significance annotations, error bars, colorblind-safe palettes, and specific journal formatting (Nature, Science, Cell). Orchestrates matplotlib/seaborn/plotly with publication styles. For quick exploration use seaborn or plotly directly.
license
MIT license
metadata
{"version":"1.0","skill-author":"K-Dense Inc."}
Scientific Visualization
Overview
Scientific visualization transforms data into clear, accurate figures for publication. Create journal-ready plots with multi-panel layouts, error bars, significance markers, and colorblind-safe palettes. Export as PDF/EPS/TIFF using matplotlib, seaborn, and plotly for manuscripts.
When to Use This Skill
This skill should be used when:
Creating plots or visualizations for scientific manuscripts
Preparing figures for journal submission (Nature, Science, Cell, PLOS, etc.)
Ensuring figures are colorblind-friendly and accessible
Making multi-panel figures with consistent styling
Exporting figures at correct resolution and format
Following specific publication guidelines
Improving existing figures to meet publication standards
Creating figures that need to work in both color and grayscale
Critical requirements (detailed in references/publication_guidelines.md):
Raster images (photos, microscopy): 300-600 DPI
Line art (graphs, plots): 600-1200 DPI or vector format
Vector formats (preferred): PDF, EPS, SVG
Raster formats: TIFF, PNG (never JPEG for scientific data)
Implementation:
# Use the figure_export.py script for correct settingsfrom figure_export import save_publication_figure
# Saves in multiple formats with proper DPI
save_publication_figure(fig, 'myfigure', formats=['pdf', 'png'], dpi=300)
# Or save for specific journal requirementsfrom figure_export import save_for_journal
save_for_journal(fig, 'figure1', journal='nature', figure_type='combination')
2. Color Selection - Colorblind Accessibility
Always use colorblind-friendly palettes (detailed in references/color_palettes.md):
Recommended: Okabe-Ito palette (distinguishable by all types of color blindness):
from color_palettes import apply_palette
import matplotlib.pyplot as plt
apply_palette('okabe_ito')
# Add redundant encoding beyond color
line_styles = ['-', '--', '-.', ':']
markers = ['o', 's', '^', 'v']
for i, (data, label) inenumerate(datasets):
plt.plot(x, data, linestyle=line_styles[i % 4],
marker=markers[i % 4], label=label)
Statistical Rigor
Always include:
Error bars (SD, SEM, or CI - specify which in caption)
Sample size (n) in figure or caption
Statistical significance markers (*, **, ***)
Individual data points when possible (not just summary statistics)
Example with statistics:
# Show individual points with summary statistics
ax.scatter(x_jittered, individual_points, alpha=0.4, s=8)
ax.errorbar(x, means, yerr=sems, fmt='o', capsize=3)
# Mark significance
ax.text(1.5, max_y * 1.1, '***', ha='center', fontsize=8)
Working with Different Plotting Libraries
Matplotlib
Most control over publication details
Best for complex multi-panel figures
Use provided style files for consistent formatting
See references/matplotlib_examples.md for extensive examples
Seaborn
Seaborn provides a high-level, dataset-oriented interface for statistical graphics, built on matplotlib. It excels at creating publication-quality statistical visualizations with minimal code while maintaining full compatibility with matplotlib customization.
Key advantages for scientific visualization:
Automatic statistical estimation and confidence intervals
Built-in support for multi-panel figures (faceting)
Colorblind-friendly palettes by default
Dataset-oriented API using pandas DataFrames
Semantic mapping of variables to visual properties
Quick Start with Publication Style
Always apply matplotlib publication styles first, then configure seaborn:
import seaborn as sns
import matplotlib.pyplot as plt
from style_presets import apply_publication_style
# Apply publication style
apply_publication_style('default')
# Configure seaborn for publication
sns.set_theme(style='ticks', context='paper', font_scale=1.1)
sns.set_palette('colorblind') # Use colorblind-safe palette# Create figure
fig, ax = plt.subplots(figsize=(3.5, 2.5))
sns.scatterplot(data=df, x='time', y='response',
hue='treatment', style='condition', ax=ax)
sns.despine() # Remove top and right spines
Use for automatic faceting by categorical variables
Create complete figures with consistent styling
Great for exploratory analysis
Use height and aspect for sizing
g = sns.relplot(data=df, x='x', y='y', col='category', kind='scatter')
Statistical Rigor with Seaborn
Seaborn automatically computes and displays uncertainty:
# Line plot: shows mean ± 95% CI by default
sns.lineplot(data=df, x='time', y='value', hue='treatment',
errorbar=('ci', 95)) # Can change to 'sd', 'se', etc.# Bar plot: shows mean with bootstrapped CI
sns.barplot(data=df, x='treatment', y='response',
errorbar=('ci', 95), capsize=0.1)
# Always specify error type in figure caption:# "Error bars represent 95% confidence intervals"
Best Practices for Publication-Ready Seaborn Figures