Skip to content
cccskills
FreePublished on GitHub

stata-style-figures

Style every matplotlib figure like the Stata 18/19 default (stcolor) scheme — Arial embedded as TrueType, white background, recessive light-gray grid below the data, no top/right spines, unframed legends, and the validated blue/red/gray palette. Use whenever a task generates or restyles charts, plots, or figures for papers, reports, or slides, even if the user doesn't mention Stata — this is the house style for all publication figures. Also use when asked to make figures "look like Stata", match the stcolor scheme, or restyle existing matplotlib output.

The English summary is being prepared. Showing the original description.

Run score Not tested

See how to install

Files included (2)

  • SKILL.md3.8 KB
  • README.md3.3 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

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

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

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

ax.grid(axis="y", color=STC_GRID, lw=0.6, zorder=0)   # horizontal gridlines only
ax.tick_params(length=2.5, color="0.4")
ax.legend(frameon=False)

Grid rule: value-axis gridlines only. Vertical charts (time series, vertical bars) get axis="y"; horizontal bar/dot charts get axis="x" instead. Never both. White figure and axes background (matplotlib default — don't set facecolors), no chart junk.

Output format — PNG by default

Save charts, figures, and visual diagrams as .png unless the task explicitly asks for another format (a LaTeX manuscript pipeline that \includegraphics a PDF, for instance, keeps PDF):

fig.savefig(path.with_suffix(".png"), dpi=300)

300 dpi keeps text crisp at print size. The font-embedding rcParams (pdf.fonttype) are harmless for PNG — keep the block as is so a later PDF export just works.

Semantics rule — restyling never changes content

A restyle touches colour and font only. Encodings that captions or notes describe — filled vs open markers, dashed vs solid lines, shading, marker sizes that carry meaning — stay exactly as they were. Verify: hash the underlying data artifacts (tables, JSON, parquet the figure is built from) before and after; they must be identical. If the generator emits a numbers JSON or .tex alongside the figure, those hashes are the check.

Chart-type patterns

The style was validated across these chart types; the rcParams block and palette above carry everything needed to reproduce them:

  • multi-panel time series with a shaded band and baseline-vs-corrected series
  • horizontal dot/lollipop rankings (vertical-only grid; filled/open/gray marker semantics)
  • median curve with a min-max band (STC_BLUE_LIGHT fill)
  • grouped-bar and reinstatement-style variants

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Build human adjudication / hand-labeling sheets from LLM-pipeline data without evidence truncation. Use when: (1) preparing a CSV/Excel sheet for a human to rule on cases an LLM classifier or rater panel judged, (2) a labeler reports "there is no information to label from" or cells look empty in Excel, (3) excerpt columns cluster at one exact length (e.g. all 1,500 chars — a hard truncation cap). Covers: full rating-basis recovery, Excel 32,767-char cell cap, multi-line CSV mangling, ruling dropdowns, companion text files.

The English summary is being prepared. Showing the original description.

kennethkhoocy/applied-micro-skills20Updated Sep 5, 2026

N-round adversarial review pipeline for empirical research output — the chain from data to LaTeX tables to a manuscript that cites them. A Claude drafter proposes minimal diffs, a deterministic mechanical battery gates every diff from a clean state with a regression gate, a Codex reviewer files check-backed critiques, and a blind judge panel decides residual disputes. Manual-invoke ONLY: trigger when the user explicitly runs /adversarial-empirical-review or names 'adversarial-empirical-review' / 'adversarial empirical review'. Do NOT auto-trigger on generic 'review my results', 'check my tables', or manuscript-editing requests. For prose-style refinement use style-emulation instead; this skill AUDITS WHETHER THE TABLES ARE CORRECT — that each number in the tables is what the analysis code computes, reproduces from the data, and is internally consistent. It is an empirical + code review: the manuscript is read only to resolve table numbering, and prose is not examined.

The English summary is being prepared. Showing the original description.

kennethkhoocy/applied-micro-skills20Updated Sep 5, 2026

Before designing, training, or auditing ANY model that replicates human-annotated labels, audit the annotation protocol's INPUT — the exact document/evidence the human labelers consulted — and give the model that same input. Use when: (1) designing a classifier/LLM extractor whose target is a hand-coded label set, (2) a label-replication model shows low recall concentrated in a label subset and the diagnosis on offer is "the label's information is not in the features", (3) reviewers propose construct splits (e.g. "designation vs record-evident"), adjudication sittings, or per-domain stop rules to explain residual disagreement with gold, (4) validating an extraction pipeline against labels transcribed from a source document. Symptom of the underlying failure: elaborate theory accumulates to explain why gold is "partially unpredictable" when the model was simply never shown the document the annotators read.

The English summary is being prepared. Showing the original description.

kennethkhoocy/applied-micro-skills20Updated Sep 5, 2026

Raise real concurrency in asyncio LLM batch scorers built on the OpenAI SDK (AsyncOpenAI, including OpenAI-compatible providers like DeepSeek). Use when: (1) raising an asyncio.Semaphore above ~100 produces no throughput gain, (2) a batch pipeline saturates near 100 in-flight requests despite a larger semaphore, (3) planning a high-concurrency campaign against a provider with no hard rate limit (DeepSeek v4-flash tolerates 2000+ in flight). Root cause: AsyncOpenAI's default httpx pool caps max_connections at 100, silently bottlenecking any larger semaphore — you must pass a custom http_client with httpx.Limits sized to the semaphore.

The English summary is being prepared. Showing the original description.

kennethkhoocy/applied-micro-skills20Updated Sep 5, 2026

Place pre-screened literature citations into a LaTeX or Word manuscript, or restyle the citations already in one. Three modes: (1) inline placement — inline \cite{}/\citet{}/\citep{} with a compiled references.bib, for author-date journals (APA, MLA, Harvard, Chicago author-date, IEEE, Vancouver); (2) footnote placement — full formatted \footnote{} or OOXML footnotes for legal and notes styles (Bluebook, OSCOLA, Chicago, APA, McGill) with Id./supra short forms; (3) restyle — convert existing footnote citations from one style to another. This skill is manual-invoke ONLY — trigger ONLY when the user explicitly runs /cite-placement or explicitly names the "cite-placement" skill. Do NOT auto-trigger on general citation, footnote, or reference requests.

The English summary is being prepared. Showing the original description.

kennethkhoocy/applied-micro-skills20Updated Sep 5, 2026

Download the actual PDF binary from bot-gated sites (taxpolicycenter.org, urban.org, SSRN-hosted mirrors, think-tank/publisher sites) via the Wayback Machine id_ URL form. Use when: (1) curl/WebFetch of a .pdf URL returns HTML instead of a PDF even with a browser User-Agent, (2) pypdf fails with "invalid pdf header: b'<!DOC'" or "EOF marker not found" on a freshly downloaded file, (3) Firecrawl can parse the PDF to markdown but you need the original file on disk (e.g., filing a reference copy).

The English summary is being prepared. Showing the original description.

kennethkhoocy/applied-micro-skills20Updated Sep 5, 2026

See all skills by kennethkhoocy

Report a problem with this skill