stata-style-figureslisted
Install: claude install-skill kennethkhoocy/applied-micro-skills
# Stata-style (stcolor) matplotlib figures
House style for publication figures, extracted from validated generators. Paste the
rcParams block, use the palette constants, follow the grid rule, and never let a
restyle change data content.
## rcParams — paste at the top of every figure script
```python
plt.rcParams.update({
"font.family": "sans-serif",
"font.sans-serif": ["Arial", "Helvetica", "DejaVu Sans"],
"mathtext.fontset": "custom",
"mathtext.rm": "Arial", "mathtext.it": "Arial:italic", "mathtext.bf": "Arial:bold",
"pdf.fonttype": 42, "ps.fonttype": 42, # embed fonts as TrueType
"font.size": 9, "axes.linewidth": 0.6, "axes.edgecolor": "0.2",
"axes.spines.top": False, "axes.spines.right": False, "axes.axisbelow": True,
})
```
`font.size` 9 for single/1x2 panels; drop to 8.5 when panels are dense (many tick
labels). Figure width 6.5 in = `\textwidth` at 1-inch margins; include at
`width=\textwidth` so fonts render at stated size (no downscaling).
## Palette
```python
STC_BLUE = "#1f77b4" # protagonist series
STC_RED = "#d62728" # accent / contrast series
STC_GRAY = "0.62" # de-emphasised series
STC_BLUE_LIGHT = "#c1d9ec" # shaded bands / intervals (light step of the blue)
STC_GRID = "#e3e6e8" # gridlines
```
Baseline-vs-corrected comparisons: dashed gray baseline (`color="0.50", ls="--"`)
vs solid blue corrected. Background/context shading: `axvspan(..., color="0.93")`.
## Per-axes styling
```python