Design defaults & override policy¶
gtviz’s purpose is to make the brand defaults win over matplotlib’s: call a chart function with data only, and you get the report look. Every styling decision is also a kwarg, so one-off overrides never require touching library code.
Source of truth¶
Defaults were audited line-by-line from the production gp_reports code
(report_params.py, visualization_functions.py, report_functions.py).
Where the original had a single consistent value, that value is the
default, verbatim.
element |
brand default |
override |
|---|---|---|
export DPI |
300 |
|
inline figure DPI |
300 (original) |
|
base / legend / title font |
14 / 14 / 16 pt |
rcParams after |
titles |
bold, left-aligned; optional gray “n = X respondents” subtitle |
|
spines |
top/right off (“report” profile) |
rcParams |
line width |
2.5 (“report” profile) |
|
publication style |
spineless, tickless, bold titles, pads 10/15 |
|
brand font |
Neutraface Text (must be installed) |
|
dot marker |
|
|
dot error style |
same-color hlines, no caps |
draw your own on the returned |
dot value labels |
off |
|
dot grid / ticks |
dotted |
— |
grouped-dot series |
|
|
grouped-dot layout |
figsize (9,4), no box, legend frameless @ (1, 0.85), xlim (−1,101), “Percent” labelpad 10, n= in legend, 25-char label wrap |
|
parallel bars |
width 0.75, alpha 0.5, panel titles 12pt pad 1, suptitle 18 bold |
kwargs |
rolling trend |
figsize (10,6), thick (2.5) plain lines in the tableau cycle (no markers), frameless inside legend, no grid, no top/right spines, bold left title + gray subtitle |
|
split lines |
figsize (10,6), thick plain lines in the tableau cycle (no markers) |
|
Likert bars |
4-pt |
|
stacked band bars |
red→orange→olive→green→blue 5-band scale, horizontal legend on top, x 0-100, bold title + gray n-subtitle |
|
waffle |
tab10 sequence (blue, red, purple, orange, …), right-side frameless legend with values in labels, bold left title, |
|
venn |
7×7, area-proportional, brand set colors (steel blue/turquoise/green, alpha 0.6), % of sample labels, n-subtitle |
|
funnel |
half-width 11, bands 2.8 gap 0.2, white 10pt labels, title 12pt |
kwargs |
donut |
wedge width 0.5, start 90° clockwise, no % labels |
|
scale bar |
figsize (8, 0.4), 0.2 lw black edges, 5pt labels, Spectral-25 |
kwargs |
HTML table |
|
constructor args / |
choropleth |
Spectral-25, absolute scale extended 30% |
|
Open decisions¶
Where the originals contradicted each other or a faithful default has a known cost, the current default is marked; flip by decision:
Inline
figure.dpi300 (original) makes notebook figures very large. Alternative: 110 for display with 300 kept forsavefig/export. Current default: 300 (faithful).Legend fontsize: rcParams say 14; the pew/stress stacked bars and a few others locally used 12. Current default: inherit 14; pass
plt.legend(fontsize=12)-style overrides per chart.Heatmap colormap: the originals used the seaborn default (dark “rocket”), which does not ship with matplotlib. Current default:
YlGnBu; closest built-in to the original ismagma— one-line change.Series palette scope: dot plots used the tab-color list; split-line charts used a different light-gray-first list. Both ship (
palette["series"],palette["split_series"]); consolidating to one list is a decision, not a default.
When one of these is decided, change it in theme.py (palettes/profiles)
or the function signature default — CI’s visual-regression job will show
exactly which charts changed, and compare_images.py --update blesses the
new baselines.