Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Create journal-quality scientific figures with proper styling and accessibility
.claude/skills/brycewang-stanford-publication-figures-guide/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 76% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 55% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 40% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 136% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 137% | 0% |
A skill for creating publication-quality scientific figures that meet journal standards for resolution, formatting, accessibility, and visual clarity. Covers matplotlib, seaborn, and ggplot2 workflows with journal-ready export settings.
| Requirement | Typical Spec | Notes | |------------|-------------|-------| | Resolution | 300-600 DPI | 300 DPI minimum for print | | File format | PDF, EPS, TIFF | Vector (PDF/EPS) preferred | | Color mode | CMYK for print, RGB for online | Check journal spec | | Max width | Single column: 3.3in / Double: 6.7in | Varies by journal | | Font size | 6-8pt minimum | Must be legible at final print size | | Line width | 0.5-1.5pt | Thin lines may not reproduce | | File size | Varies (often <10MB per figure) | TIFF can be large |
pythonimport matplotlib.pyplot as plt import matplotlib as mpl import numpy as np def setup_publication_style(journal: str = 'nature'): """ Configure matplotlib for publication-quality figures. """ styles = { 'nature': { 'figure.figsize': (3.3, 2.5), # single column 'font.size': 7, 'font.family': 'sans-serif', 'font.sans-serif': ['Arial', 'Helvetica'], 'axes.linewidth': 0.5, 'axes.labelsize': 8, 'xtick.labelsize': 7, 'ytick.labelsize': 7, 'legend.fontsize': 6, 'lines.linewidth': 1.0, 'lines.markersize': 4, 'savefig.dpi': 300, 'savefig.bbox': 'tight', 'savefig.pad_inches': 0.05, }, 'ieee': { 'figure.figsize': (3.5, 2.6), 'font.size': 8, 'font.family': 'serif', 'font.serif': ['Times New Roman', 'Times'], 'axes.linewidth': 0.5, 'axes.labelsize': 9, 'xtick.labelsize': 8, 'ytick.labelsize': 8, 'legend.fontsize': 7, 'lines.linewidth': 1.0, 'savefig.dpi': 300, }, 'acs': { 'figure.figsize': (3.25, 2.5), 'font.size': 7, 'font.family': 'sans-serif', 'font.sans-serif': ['Arial'], 'axes.linewidth': 0.5, 'savefig.dpi': 600, } } style = styles.get(journal, styles['nature']) mpl.rcParams.update(style) return style setup_publication_style('nature')
pythondef get_accessible_palette(n_colors: int = 8, style: str = 'categorical') -> list: """ Return colorblind-friendly palettes. """ palettes = { 'categorical': { # Wong (2011) Nature Methods palette 3: ['#0072B2', '#D55E00', '#009E73'], 4: ['#0072B2', '#D55E00', '#009E73', '#CC79A7'], 5: ['#0072B2', '#D55E00', '#009E73', '#CC79A7', '#F0E442'], 8: ['#0072B2', '#D55E00', '#009E73', '#CC79A7', '#F0E442', '#56B4E9', '#E69F00', '#000000'] }, 'sequential': { # Viridis-based (perceptually uniform) 'cmap': 'viridis' # Also: 'cividis', 'inferno', 'magma' }, 'diverging': { 'cmap': 'RdBu_r' # Also: 'coolwarm', 'BrBG' } } if style == 'categorical': n = min(n_colors, 8) return palettes['categorical'].get(n, palettes['categorical'][8][:n]) else: return palettes[style] # Usage colors = get_accessible_palette(4)
pythondef publication_barplot(data: dict, ylabel: str, title: str = '', output: str = 'figure.pdf'): """ Create a publication-quality bar chart. Args: data: Dict mapping group names to (mean, std_error) tuples """ setup_publication_style('nature') colors = get_accessible_palette(len(data)) fig, ax = plt.subplots() x = np.arange(len(data)) names = list(data.keys()) means = [data[k][0] for k in names] errors = [data[k][1] for k in names] bars = ax.bar(x, means, yerr=errors, capsize=3, color=colors, edgecolor='black', linewidth=0.5, width=0.6, error_kw={'linewidth': 0.5}) ax.set_xticks(x) ax.set_xticklabels(names, rotation=0) ax.set_ylabel(ylabel) if title: ax.set_title(title) # Remove top and right spines ax.spines['top'].set_visible(False) ax.spines['right'].set_visible(False) fig.savefig(output, dpi=300, bbox_inches='tight') plt.close() return output
pythonfrom scipy import stats def publication_scatter(x, y, xlabel, ylabel, output='scatter.pdf', groups=None, group_labels=None): """Publication-quality scatter plot with optional regression line.""" setup_publication_style('nature') fig, ax = plt.subplots() if groups is None: ax.scatter(x, y, s=15, alpha=0.7, color='#0072B2', edgecolors='none') # Regression line slope, intercept, r, p, se = stats.linregress(x, y) x_fit = np.linspace(min(x), max(x), 100) ax.plot(x_fit, slope*x_fit + intercept, '--', color='#D55E00', linewidth=0.8) ax.text(0.05, 0.95, f'r = {r:.2f}, p = {p:.3f}', transform=ax.transAxes, fontsize=6, va='top') else: colors = get_accessible_palette(len(set(groups))) for i, label in enumerate(group_labels or sorted(set(groups))): mask = np.array(groups) == label ax.scatter(np.array(x)[mask], np.array(y)[mask], s=15, alpha=0.7, color=colors[i], label=label) ax.legend(frameon=False) ax.set_xlabel(xlabel) ax.set_ylabel(ylabel) ax.spines['top'].set_visible(False) ax.spines['right'].set_visible(False) fig.savefig(output, dpi=300, bbox_inches='tight') plt.close()
pythondef multi_panel_figure(n_rows, n_cols, panel_data, output='multipanel.pdf'): """Create a multi-panel figure with automatic panel labels.""" setup_publication_style('nature') fig, axes = plt.subplots(n_rows, n_cols, figsize=(3.3*n_cols, 2.5*n_rows)) if n_rows * n_cols == 1: axes = np.array([axes]) axes = axes.flatten() labels = 'abcdefghijklmnopqrstuvwxyz' for i, ax in enumerate(axes[:len(panel_data)]): # Add panel label ax.text(-0.15, 1.05, labels[i], transform=ax.transAxes, fontsize=10, fontweight='bold', va='bottom') plt.tight_layout() fig.savefig(output, dpi=300, bbox_inches='tight') plt.close()
plt.rcParams['pdf.fonttype'] = 42)python# Ensure fonts are embedded in PDF output mpl.rcParams['pdf.fonttype'] = 42 # TrueType fonts mpl.rcParams['ps.fonttype'] = 42
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-02 | fail→pass | 17,158 | 17,464 | +2% | 1 | 1 | 0% | 3,460 | 6,083 | +76% | 0 | 0 | — |
case-03 | fail→fail | 20,192 | 19,647 | -3% | 1 | 1 | 0% | 3,679 | 6,507 | +77% | 0 | 0 | — |
case-01 | fail→fail | 22,754 | 23,301 | +2% | 1 | 1 | 0% | 4,576 | 6,531 | +43% | 0 | 0 | — |
case-04 | fail→fail | 18,848 | 17,520 | -7% | 1 | 1 | 0% | 3,525 | 5,641 | +60% | 0 | 0 | — |
case-05 | fail→pass | 20,424 | 18,814 | -8% | 1 | 1 | 0% | 3,890 | 6,028 | +55% | 0 | 0 | — |
case-06 | pass→pass | 6,059 | 6,205 | +2% | 1 | 1 | 0% | 1,031 | 3,387 | +229% | 0 | 0 | — |
case-07 | fail→pass | 16,773 | 11,914 | -29% | 1 | 1 | 0% | 3,313 | 4,630 | +40% | 0 | 0 | — |
case-08 | fail→fail | 9,401 | 9,199 | -2% | 1 | 1 | 0% | 2,063 | 4,389 | +113% | 0 | 0 | — |
case-13 | fail→fail | 17,973 | 21,257 | +18% | 1 | 1 | 0% | 3,163 | 6,312 | +100% | 0 | 0 | — |
case-09 | pass→pass | 14,694 | 13,708 | -7% | 1 | 1 | 0% | 2,063 | 4,803 | +133% | 0 | 0 | — |
case-10 | pass→pass | 14,134 | 14,858 | +5% | 1 | 1 | 0% | 2,376 | 4,967 | +109% | 0 | 0 | — |
case-11 | fail→fail | 22,726 | 14,056 | -38% | 1 | 1 | 0% | 4,541 | 5,195 | +14% | 0 | 0 | — |
case-12 | pass→pass | 15,559 | 15,548 | -0% | 1 | 1 | 0% | 3,125 | 5,438 | +74% | 0 | 0 | — |
case-14 | fail→pass | 12,038 | 16,164 | +34% | 1 | 1 | 0% | 2,211 | 5,212 | +136% | 0 | 0 | — |
case-15 | fail→pass | 9,050 | 8,159 | -10% | 1 | 1 | 0% | 1,639 | 3,887 | +137% | 0 | 0 | — |
case-16 | pass→pass | 11,558 | 5,946 | -49% | 1 | 1 | 0% | 2,009 | 3,309 | +65% | 0 | 0 | — |
case-17 | pass→pass | 10,204 | 8,343 | -18% | 1 | 1 | 0% | 1,647 | 3,768 | +129% | 0 | 0 | — |
case-18 | fail→pass | 14,832 | 15,781 | +6% | 1 | 1 | 0% | 2,456 | 5,047 | +105% | 0 | 0 | — |
case-19 | pass→pass | 8,690 | 3,064 | -65% | 1 | 1 | 0% | 1,340 | 2,898 | +116% | 0 | 0 | — |
case-20 | pass→pass | 18,463 | 19,180 | +4% | 1 | 1 | 0% | 3,299 | 5,681 | +72% | 0 | 0 | — |
case-21 | pass→pass | 19,959 | 25,136 | +26% | 1 | 1 | 0% | 3,636 | 7,282 | +100% | 0 | 0 | — |
case-22 | pass→pass | 17,532 | 22,773 | +30% | 1 | 1 | 0% | 3,732 | 7,441 | +99% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +27 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.