*! factsheetplot 0.1.0 24aug2026

Title

factsheetplot -- Apply standardized factsheet style to a Stata
graph

Syntax

factsheetplot
[using filename]
[, graph(name) set width(#) replace]

Description

factsheetplot redraws the current Stata graph using the factsheet scheme
and an 8-by-5 aspect ratio. If using is specified, the redrawn graph is
exported to filename.

The command standardizes the graph background, type treatment, axes, default
plot colors, dimensions, and export resolution. It does not change the data,
estimates, labels, reference lines, or other substantive content used to
create the graph.

Researchers may retain meaningful visual distinctions by specifying options
such as lcolor(), lpattern(), and mcolor() in the original
graph command. Explicit graph options take precedence over the factsheet
scheme.

Options

graph(name) redraws and exports the named graph instead of the current
graph.

set makes the factsheet scheme the default for graphs subsequently
created in the current Stata session. This setting is not permanent. When
set is used by itself, it does not require an open graph.

width(#) sets the exported image width in pixels. The default is
width(1600).

replace permits graph export to overwrite an existing file.

Examples

Convert and export the current graph:

. synth outcome predictors, trunit(1) trperiod(20) fig

. factsheetplot using "figures/scm_outcome.png", replace

Activate the style before running a graph producing command:

. factsheetplot, set

. twoway (line observed date) (line comparison date)

. factsheetplot using "figures/outcome.png", replace

Retain meaningful colors selected in the original graph command:

. factsheetplot, set

. local higher "67 57 107"

. local lower "27 177 190"

. twoway (line higher_gap date, lcolor("`higher'")) (line lower_gap date, lcolor("`lower'"))

. factsheetplot using "figures/price_groups.png", replace

Convert a named graph:

. factsheetplot using "figures/outcome.png", graph(results) replace

Remarks

Post-hoc conversion works best when the original graph relies on scheme
defaults. If a graph producing command hard codes colors, fonts, regions, or
legend positions, run factsheetplot, set before that command and remove
unnecessary explicit style options where practical.

The built-in figure produced by synth is one example: synth
explicitly draws both series in black. factsheetplot standardizes the
surrounding graph but preserves those hard coded line colors. To use another
palette, save the synth output and recreate the graph with twoway.

factsheetplot cannot infer the substantive meaning of individual plot
elements. If an automatic graph command does not expose options for styling
individual series, use the standard palette or recreate the graph from the
command's saved output.

Author

Samuel Sturm

Support: ssturm@jhu.edu

License

MIT License. See the bundled factsheetplot.license file.