SSCI Academic Figure Style
1. Core Principles
Three design commitments guide every figure this Skill produces:
-
Data-ink ratio: Every pixel should convey data. Remove gridlines, 3D effects, and decorative elements -- they add visual noise without information value (Tufte, 1983). Use clean L-shaped axes (top and right spines off).
-
Colorblind-safe and grayscale-compatible: About 8% of male readers have red-green color vision deficiency. Categorical palettes default to validated CVD-safe sets (Tol, 2021; Wong, 2011; Okabe & Ito, 2008) and pair color with a redundant channel (line style, marker shape, or hatching) so every figure remains readable in grayscale print. Journal-anchored palettes (NPG, AAAS, NEJM, Lancet, BMJ, JAMA) are provided to match house style at submission and are flagged with their CVD grade in
list_palettes(). -
Clean figure + separate text: The saved image contains only the data visualization (axes, data, legend). Figure number, title, and Note are output as standalone Markdown text for the user to place in the manuscript. This matches APA 7th Edition requirements and most journal submission guidelines where captions are supplied separately from image files.
Initialize the style system at the start of every figure:
from scripts.ssci_style import *
apply_style() # 70+ rcParams, colormaps, fonts
apply_style(journal='nejm') # Auto-loads matching palette + sizes
apply_style(journal='psych_science', mode='slides') # Larger fonts for talks
2. Workflow
Step 1 -- Confirm Requirements
Before writing code, identify:
- (a) Chart type from the decision table below (or its chart-family reference file)
- (b) Target journal, if the user specifies one (12 presets available)
- (c) Number of groups or conditions (determines palette size)
- (d) Error metric: SE, SD, or 95% CI
Step 2 -- Initialize Style
Run apply_style() to set all rcParams, register colormaps, and embed fonts.
If the user specifies a target journal, pass it as an argument and read references/journal-presets.md for details:
# Available journal keys (12):
# apa, elsevier, wiley, sage, psych_science, asa,
# nature, science, nejm, lancet, bmj, jama
apply_style(journal='lancet')
apply_style(journal=...) also auto-loads the matching default palette via axes.prop_cycle (e.g. journal='nejm' activates the nejm palette). For slide / poster usage, add mode='slides' to bump font sizes without touching the underlying preset.
Step 3 -- Build the Figure
Open references/chart-type-guide.md first. It is the Index to the 55-chart catalog and routes you to one of the four chart-family files (chart-types-core.md, chart-types-models.md, chart-types-causal-econ.md, chart-types-applied.md) or the quick-reference file. Follow the design elements, parameters, and code patterns documented there.
Color selection:
- Categorical data:
get_palette(n)returns n CVD-safe hex colors (default: Tol Bright). Usecategory=/name=for discipline- or journal-anchored alternatives. - Emphasis focal + reference pair:
get_emphasis_pair(focal=..., reference=...)returns two colors for "focal series vs neutral reference" patterns (treatment vs control, event-study, simple slopes). - Heatmap:
get_diverging_cmap('BuRd')withTwoSlopeNorm(vcenter=0)for zero-centered diverging data. - Sequential data:
get_sequential_cmap('viridis')(perceptually uniform); alsocividis / plasma / inferno / magma / Blues / Oranges / tailwind_slate. - Multi-panel composition: see
references/multi-panel.mdforcompose_grid/small_multiples/add_inset/ shared legend & colorbar / marginal histogram. - Always pair color with redundant coding (
LINE_STYLES,MARKERS, orHATCHESfromssci_style).
Step 4 -- Validate
Check every item in the Quality Checklist (Section 6 below) before saving.
If the figure includes statistical annotations (p-values, effect sizes, CI, inline statistics), read references/statistical-annotations.md for exact formatting rules. For APA figure text formatting details (number, title, Note, multi-panel conventions, mediation diagram conventions), read references/apa-figure-standards.md.
Step 5 -- Save and Output
Save the figure in multiple formats using save_figure():
save_figure(fig, 'fig_1') # Default: PDF + PNG (600 DPI)
save_figure(fig, 'fig_1', formats=('pdf', 'tiff')) # Journal submission (RGB TIFF)
Then output the figure description text separately as Markdown, using format_apa_figure_text():
text = format_apa_figure_text(
figure_number=1,
title="Mean Anxiety Scores by Treatment Condition and Time Point",
note_text="N = 354. PSS = perceived stress scale; SWB = subjective well-being.",
p_levels=[("*", ".05"), ("**", ".01"), ("***", ".001")],
error_bar_type="95ci", # auto-emits standard error-bar statement
)
Output format:
Figure 1
Mean Anxiety Scores by Treatment Condition and Time Point
Note. N = 354. Error bars represent 95% confidence intervals. PSS = perceived stress scale; SWB = subjective well-being.
*p < .05. **p < .01. ***p < .001.
3. Chart Type Selection
The full catalog has 55 chart types organized by family. Use this top-level table for routing; then load the chart-family file for the detailed 6-section spec.
3.1 By chart family
| Family | File | Chart sections (representative) |
|---|---|---|
| Core distribution & relationship | chart-types-core.md | §1 Grouped Bar, §2 Error Bar, §3 Line, §3.1 Annotated Time Series, §4 Scatter+Regression, §4.1 Scatter with Marginal Histogram, §5 Box, §6 Violin, §7 Correlation Heatmap |
| Statistical model output | chart-types-models.md | §8 Forest, §8.1 Coefficient/Dot-Whisker, §9 Path/SEM, §9.1 IV Diagram, §10 Mediation (incl. §10.1 Serial, §10.2 Parallel), §11 Interaction, §11.1 Categorical Moderator, §11.2 Continuous Marginal Effect, §12 Simple Slopes, §17 Scree+Parallel Analysis, §18 Profile (LPA/LCA), §19 Growth Curve, §32 Specification Curve, §33 Causal DAG |
| Causal inference / econometrics | chart-types-causal-econ.md | §22 Event-Study Coefficient Plot, §23 DID Parallel Trends, §24 Regression Discontinuity, §25 Binned Scatter (Binscatter), §26 Coefficient Plot multi-model, §38 IV Diagram |
| Applied / specialty | chart-types-applied.md | §14 Raincloud, §16 Funnel, §20 Kaplan-Meier (with at-risk table), §21 Bland-Altman, §27 Ridgeline/Joy, §28 Choropleth, §29 ROC + Calibration, §30 Mobility Transition Matrix, §31 Marginal Effects |
| Quick reference (one-page each) | chart-types-quick-reference.md | §15.1 Histogram, §15.2 Density (KDE), §15.3 Swarm/Beeswarm, §15.4 Factor Loading, §15.5 Johnson-Neyman, §15.6 CONSORT, §15.7 Lollipop, §15.8 Slope/Bump, §15.9 Dumbbell, §15.10 Population Pyramid, §15.11 Tornado/Butterfly |
| Multi-panel composition | multi-panel.md | compose_grid, small_multiples, add_inset, shared legend/colorbar, marginal histogram, subfigures |
3.2 By discipline (decision shortcut)
| Discipline | Primary chart-family file |
|---|---|
| Psychology — descriptive | chart-types-core.md |
| Psychology — modeling (SEM, mediation, forest, simple slopes, growth) | chart-types-models.md |
| Economics — causal (event-study, DID, RD, IV, binscatter) | chart-types-causal-econ.md |
| Public health & medicine (KM, ROC, funnel, Bland-Altman) | chart-types-applied.md |
| Sociology (mobility matrix, ridgeline) | chart-types-applied.md |
| Political science (annotated time series, ideological scaling, choropleth) | chart-types-applied.md + chart-types-core.md §3.1 |
| Geography (choropleth, spatial overlays) | chart-types-applied.md |
| Methodology / robustness (specification curve, DAG) | chart-types-models.md |
3.3 Cross-cutting routing table
| Data /