Skip to content

chore(palette): migrate plotnine impls from Okabe-Ito to imprint#7780

Merged
MarkusNeusinger merged 2 commits into
mainfrom
chore/migrate-imprint-plotnine
May 27, 2026
Merged

chore(palette): migrate plotnine impls from Okabe-Ito to imprint#7780
MarkusNeusinger merged 2 commits into
mainfrom
chore/migrate-imprint-plotnine

Conversation

@MarkusNeusinger
Copy link
Copy Markdown
Owner

Summary

Semantic fixes (proactive)

File Fix
bar-diverging "Negative" → red
candlestick-volume DOWN_COLOR → red
dashboard-metrics-tiles status warn → amber, critical → red
gauge-basic ZONE_BAD/WARN → red/amber traffic-light
indicator-macd ORANGE → OCHRE (var rename + #BD8233)
kagi-basic YIN_COLOR → red
logistic-regression FAIL_COLOR → red
ohlc-bar DOWN_COLOR → red
point-and-figure-basic O_COLOR → red
renko-basic BEARISH → red
shap-waterfall COLOR_POS → red (vs blue NEG)

Test plan

  • ruff check . + ruff format --check . green
  • CI green
  • Copilot triage
  • After merge: Stage B for 132 plotnine impls → GCS production

🤖 Generated with Claude Code

Positional hex replacement across 132 plotnine impls that already
ship light+dark renders, moving them from Okabe-Ito + variant-D to
imprint. Mirrors PRs #7776 (matplotlib) and #7779 (seaborn).

Includes proactive semantic-anchor fixes for 11 plotnine impls
where slot-1 (now lavender) carried explicit meaning. Variable
ORANGE in indicator-macd renamed to OCHRE so the name matches
the actual imprint hex it now points at.

- bar-diverging          "Negative"     → red
- candlestick-volume     DOWN_COLOR     → red
- dashboard-metrics-tiles status warn   → amber, critical → red
- gauge-basic            ZONE_BAD/WARN  → red/amber traffic-light
- indicator-macd         ORANGE→OCHRE   (var rename + #BD8233 ochre)
- kagi-basic             YIN_COLOR      → red
- logistic-regression    FAIL_COLOR     → red
- ohlc-bar               DOWN_COLOR     → red
- point-and-figure-basic O_COLOR        → red
- renko-basic            BEARISH        → red
- shap-waterfall         COLOR_POS      → red (vs blue NEG)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 27, 2026 21:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates Plotnine plot implementations that already support light/dark renders from the legacy Okabe-Ito/variant-D palette to the canonical imprint palette (per core/palette.py), aligning Plotnine with the earlier Matplotlib/Seaborn migrations.

Changes:

  • Bulk positional hex replacement across many plots/**/implementations/python/plotnine.py files to use imprint colors.
  • Targeted semantic-anchor adjustments in a subset of plots (e.g., “bad/loss” → red, “warning” → amber).
  • Minor variable renames/updates in a few implementations to better match the new palette intent (e.g., ORANGEOCHRE in MACD).

Reviewed changes

Copilot reviewed 132 out of 132 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
plots/wordcloud-basic/implementations/python/plotnine.py Swap frequency-tier palette from Okabe-Ito to imprint.
plots/windrose-basic/implementations/python/plotnine.py Update wind speed bin colors to imprint palette.
plots/waffle-basic/implementations/python/plotnine.py Replace categorical palette list with imprint.
plots/voronoi-basic/implementations/python/plotnine.py Replace early palette entries in multi-color list with imprint slots.
plots/volcano-basic/implementations/python/plotnine.py Update categorical color map to imprint hues.
plots/violin-swarm/implementations/python/plotnine.py Replace accent color with imprint slot mapping.
plots/violin-split/implementations/python/plotnine.py Replace 2-color palette with imprint.
plots/violin-grouped-swarm/implementations/python/plotnine.py Replace fill/color scale palettes with imprint.
plots/violin-box/implementations/python/plotnine.py Replace fill palette with imprint.
plots/venn-labeled-items/implementations/python/plotnine.py Update 3-set colors to imprint slots.
plots/venn-basic/implementations/python/plotnine.py Replace 3-color palette + mapping to imprint.
plots/tree-phylogenetic/implementations/python/plotnine.py Replace clade palette and leaf point color with imprint.
plots/timeseries-forecast-uncertainty/implementations/python/plotnine.py Replace historical/forecast colors with imprint mapping.
plots/timeline-basic/implementations/python/plotnine.py Replace category colors with imprint slots.
plots/swarm-basic/implementations/python/plotnine.py Replace manual scale palette with imprint.
plots/survival-kaplan-meier/implementations/python/plotnine.py Replace vline/scale palettes with imprint.
plots/sunburst-basic/implementations/python/plotnine.py Replace index-based segment colors with imprint.
plots/subplot-mosaic/implementations/python/plotnine.py Replace multiple panel palettes/usages with imprint.
plots/subplot-grid/implementations/python/plotnine.py Update secondary color + palette list to imprint hues.
plots/strip-basic/implementations/python/plotnine.py Replace manual color scale with imprint.
plots/step-basic/implementations/python/plotnine.py Replace accent color with imprint slot.
plots/span-basic/implementations/python/plotnine.py Replace line + highlighted region fill colors with imprint.
plots/sn-curve-basic/implementations/python/plotnine.py Replace multiple plot elements’ colors with imprint.
plots/smith-chart-basic/implementations/python/plotnine.py Replace palette + key annotations with imprint.
plots/skewt-logp-atmospheric/implementations/python/plotnine.py Replace legend line colors and label color with imprint.
plots/silhouette-basic/implementations/python/plotnine.py Replace 3-color palette and scale with imprint.
plots/shap-waterfall/implementations/python/plotnine.py Apply semantic mapping (pos→red, neg→blue) using imprint.
plots/scatter-text/implementations/python/plotnine.py Replace category color mapping with imprint.
plots/scatter-regression-polynomial/implementations/python/plotnine.py Replace regression line/band colors with imprint hues.
plots/scatter-regression-lowess/implementations/python/plotnine.py Replace accent color with imprint slot.
plots/scatter-regression-linear/implementations/python/plotnine.py Replace regression accent color with imprint slot.
plots/scatter-matrix/implementations/python/plotnine.py Replace color/fill scale palettes with imprint.
plots/scatter-matrix-interactive/implementations/python/plotnine.py Replace color/fill scale palettes with imprint.
plots/scatter-marginal/implementations/python/plotnine.py Replace marginal accent with imprint slot.
plots/scatter-map-geographic/implementations/python/plotnine.py Replace region color mapping with imprint.
plots/scatter-embedding/implementations/python/plotnine.py Replace categorical palette + scale with imprint.
plots/scatter-categorical/implementations/python/plotnine.py Replace palette + scale with imprint.
plots/scatter-animated-controls/implementations/python/plotnine.py Replace palette and manual scale values with imprint.
plots/sankey-basic/implementations/python/plotnine.py Replace source color mapping with imprint.
plots/roc-curve/implementations/python/plotnine.py Replace palette + scale slice with imprint.
plots/residual-plot/implementations/python/plotnine.py Replace point/LOWESS colors and manual mapping with imprint.
plots/renko-basic/implementations/python/plotnine.py Apply semantic anchors for bullish/bearish using imprint.
plots/range-interval/implementations/python/plotnine.py Replace accent color with imprint semantic hue.
plots/radar-multi/implementations/python/plotnine.py Replace palette and manual scales with imprint.
plots/radar-basic/implementations/python/plotnine.py Replace 2-color palette and manual scales with imprint.
plots/pyramid-basic/implementations/python/plotnine.py Replace palette and male/female fill mapping with imprint.
plots/precision-recall/implementations/python/plotnine.py Replace baseline accent color with imprint slot.
plots/polar-scatter/implementations/python/plotnine.py Replace palette and time-of-day mapping with imprint.
plots/polar-line/implementations/python/plotnine.py Replace palette and manual scale slice with imprint.
plots/polar-bar/implementations/python/plotnine.py Replace palette and direction mapping with imprint.
plots/point-and-figure-basic/implementations/python/plotnine.py Apply semantic anchors for X/O colors using imprint.
plots/pdp-basic/implementations/python/plotnine.py Replace rug accent with imprint slot.
plots/parliament-basic/implementations/python/plotnine.py Replace party palette list and assignment with imprint.
plots/parallel-categories-basic/implementations/python/plotnine.py Replace palette list + outcome colors with imprint.
plots/parallel-basic/implementations/python/plotnine.py Replace palette and species mapping with imprint.
plots/ohlc-bar/implementations/python/plotnine.py Apply semantic anchors for up/down colors using imprint.
plots/network-weighted/implementations/python/plotnine.py Replace edge color with imprint blue.
plots/network-transport-static/implementations/python/plotnine.py Replace route type colors with imprint hues.
plots/network-hierarchical/implementations/python/plotnine.py Replace palette and level color mapping with imprint.
plots/network-force-directed/implementations/python/plotnine.py Replace department colors mapping with imprint.
plots/network-bipartite/implementations/python/plotnine.py Replace disease color with imprint blue.
plots/network-basic/implementations/python/plotnine.py Replace palette and group color mapping with imprint.
plots/mosaic-categorical/implementations/python/plotnine.py Replace palette and survived/not mapping with imprint.
plots/map-marker-clustered/implementations/python/plotnine.py Replace category colors with imprint hues.
plots/map-drilldown-geographic/implementations/python/plotnine.py Replace bottom-3 outline + label color with imprint red.
plots/manhattan-gwas/implementations/python/plotnine.py Replace odd/even chromosome colors with imprint hues.
plots/lollipop-grouped/implementations/python/plotnine.py Replace 3-color list with imprint hues.
plots/logistic-regression/implementations/python/plotnine.py Apply semantic anchors (fail→red, pass→green, curve→blue) using imprint.
plots/line-timeseries-rolling/implementations/python/plotnine.py Replace 2-color palette + mapping with imprint.
plots/line-styled/implementations/python/plotnine.py Replace palette and product color mapping with imprint.
plots/line-stock-comparison/implementations/python/plotnine.py Replace ANYPLOT_PALETTE with IMPRINT and update usages.
plots/line-multi/implementations/python/plotnine.py Replace palette and product mapping with imprint.
plots/line-markers/implementations/python/plotnine.py Replace 2-color palette + manual scale with imprint.
plots/line-loss-training/implementations/python/plotnine.py Replace validation color with imprint slot.
plots/line-annotated-events/implementations/python/plotnine.py Replace event annotation colors with imprint slot.
plots/learning-curve-basic/implementations/python/plotnine.py Replace palette and train/val mapping with imprint.
plots/kagi-basic/implementations/python/plotnine.py Apply semantic anchors for yang/yin using imprint.
plots/indicator-sma/implementations/python/plotnine.py Replace palette + signal colors with imprint/semantic anchors.
plots/indicator-macd/implementations/python/plotnine.py Rename ORANGE→OCHRE and swap colors to imprint.
plots/indicator-bollinger/implementations/python/plotnine.py Replace band color with imprint blue.
plots/icicle-basic/implementations/python/plotnine.py Replace hierarchy palette + mapping with imprint.
plots/ice-basic/implementations/python/plotnine.py Replace accent color with imprint slot.
plots/hive-basic/implementations/python/plotnine.py Replace categorical colors with imprint slots.
plots/histogram-stepwise/implementations/python/plotnine.py Replace 2-color palette + scale with imprint.
plots/histogram-stacked/implementations/python/plotnine.py Replace 3-color palette + scale with imprint.
plots/histogram-returns-distribution/implementations/python/plotnine.py Replace palette + tail/line/vline colors with imprint.
plots/histogram-overlapping/implementations/python/plotnine.py Replace 3-color palette + fill scale with imprint.
plots/histogram-density/implementations/python/plotnine.py Replace accent color with imprint slot.
plots/gauge-basic/implementations/python/plotnine.py Apply semantic anchors (bad→red, warn→amber, good→green) using imprint.
plots/gantt-basic/implementations/python/plotnine.py Replace 5-color palette + mapping with imprint.
plots/gain-curve/implementations/python/plotnine.py Replace “Perfect” highlight color with imprint hue.
plots/funnel-basic/implementations/python/plotnine.py Replace stage palette with imprint.
plots/frontier-efficient/implementations/python/plotnine.py Replace palette usage for frontier and highlights with imprint.
plots/frequency-polygon-basic/implementations/python/plotnine.py Replace palette + color scale with imprint.
plots/facet-grid/implementations/python/plotnine.py Replace palette + scale slice with imprint.
plots/errorbar-basic/implementations/python/plotnine.py Replace palette + scale with imprint.
plots/elbow-curve/implementations/python/plotnine.py Replace palette and derived BRAND/ACCENT with imprint slots.
plots/dumbbell-basic/implementations/python/plotnine.py Replace palette and before/after mapping with imprint.
plots/drawdown-basic/implementations/python/plotnine.py Replace drawdown semantic red with imprint red.
plots/dot-matrix-proportional/implementations/python/plotnine.py Replace palette + manual scale with imprint.
plots/donut-nested/implementations/python/plotnine.py Replace base family colors with imprint hues.
plots/donut-basic/implementations/python/plotnine.py Replace palette and zip color iteration with imprint.
plots/diagnostic-regression-panel/implementations/python/plotnine.py Replace accent color with imprint slot.
plots/dendrogram-radial/implementations/python/plotnine.py Replace 3-color palette and clade mapping with imprint.
plots/dashboard-synchronized-crosshair/implementations/python/plotnine.py Replace crosshair marker semantic red with imprint red.
plots/dashboard-metrics-tiles/implementations/python/plotnine.py Apply semantic anchors and update change colors to imprint.
plots/count-basic/implementations/python/plotnine.py Replace palette and fill scale with imprint.
plots/confusion-matrix/implementations/python/plotnine.py Replace dark-theme gradient high color with imprint cyan.
plots/coefficient-confidence/implementations/python/plotnine.py Replace palette and significant mapping with imprint.
plots/circos-basic/implementations/python/plotnine.py Replace palette list and segment mapping with imprint.
plots/circlepacking-basic/implementations/python/plotnine.py Replace hierarchy palette and fill scale with imprint.
plots/chernoff-basic/implementations/python/plotnine.py Replace category colors mapping with imprint hues.
plots/cat-box-strip/implementations/python/plotnine.py Replace palette and both manual scales with imprint.
plots/candlestick-volume/implementations/python/plotnine.py Apply semantic anchors for up/down using imprint.
plots/bubble-map-geographic/implementations/python/plotnine.py Replace region palette + manual scale with imprint.
plots/box-notched/implementations/python/plotnine.py Replace palette and fill scale with imprint.
plots/box-horizontal/implementations/python/plotnine.py Replace palette and scale slice with imprint.
plots/box-grouped/implementations/python/plotnine.py Replace palette and fill scale with imprint.
plots/biplot-pca/implementations/python/plotnine.py Replace palette and color scale with imprint.
plots/bar-stacked/implementations/python/plotnine.py Replace palette and fill scale with imprint.
plots/bar-stacked-percent/implementations/python/plotnine.py Replace palette and explicit color_map with imprint.
plots/bar-spine/implementations/python/plotnine.py Replace status fill mapping with imprint.
plots/bar-race-animated/implementations/python/plotnine.py Replace categorical palette list entries with imprint hues.
plots/bar-grouped/implementations/python/plotnine.py Replace palette and fill scale with imprint.
plots/bar-drilldown/implementations/python/plotnine.py Replace palette and fill scale with imprint.
plots/bar-diverging/implementations/python/plotnine.py Apply semantic negative→red using imprint.
plots/area-stacked/implementations/python/plotnine.py Replace stacked area color list with imprint.
plots/area-stacked-percent/implementations/python/plotnine.py Replace palette and fill scale with imprint.
plots/area-stacked-confidence/implementations/python/plotnine.py Replace palette and series mapping with imprint.
plots/area-cumulative-flow/implementations/python/plotnine.py Replace palette and stage color mapping with imprint.
plots/andrews-curves/implementations/python/plotnine.py Replace palette and color scale with imprint.
plots/alluvial-basic/implementations/python/plotnine.py Replace party color mapping with imprint.

Comment on lines 38 to 41
# Okabe-Ito palette — first stage is brand green (#009E73)
OKABE_ITO = ["#009E73", "#D55E00", "#0072B2", "#CC79A7", "#E69F00"]
# Light orange (#E69F00) needs dark text for contrast; others use white.
IMPRINT = ["#009E73", "#C475FD", "#4467A3", "#BD8233", "#AE3030"]
# Light orange (#AE3030) needs dark text for contrast; others use white.
TEXT_ON_FILL = ["white", "white", "white", "white", INK]
Comment on lines +34 to 36
IMPRINT = ["#009E73", "#C475FD", "#4467A3", "#BD8233"]
GOLDEN_COLOR = "#AE3030" # amber — Okabe-Ito position 5, "golden" signal
DEATH_COLOR = INK_SOFT # muted gray — "death" signal, theme-adaptive
Comment on lines 51 to 57
# Color families - first parent uses Okabe-Ito brand (#009E73), then positions 2-4
color_families = {
"Engineering": ("#009E73", ["#009E73", "#2FA88A", "#59B5A1"]), # Okabe-Ito pos 1
"Marketing": ("#D55E00", ["#D55E00", "#DC7925", "#E5934A"]), # Okabe-Ito pos 2
"Operations": ("#0072B2", ["#0072B2", "#3589C8", "#5BA0DE"]), # Okabe-Ito pos 3
"Sales": ("#CC79A7", ["#CC79A7", "#D98FB8", "#E6A5C9"]), # Okabe-Ito pos 4
"Marketing": ("#C475FD", ["#C475FD", "#DC7925", "#E5934A"]), # Okabe-Ito pos 2
"Operations": ("#4467A3", ["#4467A3", "#3589C8", "#5BA0DE"]), # Okabe-Ito pos 3
"Sales": ("#BD8233", ["#BD8233", "#D98FB8", "#E6A5C9"]), # Okabe-Ito pos 4
}
Comment on lines 62 to 70
# Colors for wind speed bins: cool (calm) to warm (strong) progression
# Using perceptually-uniform colors appropriate for wind speed ranges
speed_colors = {
"0-5": "#0072B2", # Okabe-Ito blue (calm)
"5-10": "#56B4E9", # Okabe-Ito sky blue
"0-5": "#4467A3", # Okabe-Ito blue (calm)
"5-10": "#2ABCCD", # Okabe-Ito sky blue
"10-15": "#009E73", # Okabe-Ito green
"15-20": "#E69F00", # Okabe-Ito orange
"20+": "#D55E00", # Okabe-Ito red-orange (strong)
"15-20": "#AE3030", # Okabe-Ito orange
"20+": "#C475FD", # Okabe-Ito red-orange (strong)
}
- funnel-basic: TEXT_ON_FILL now puts INK on slot-1 (lavender, the
  lightest hue) and keeps white text on the dark slots. The previous
  mapping was a leftover from when slot-4 was yellow-orange and needed
  dark text — slot-4 is now matte red and is fine with white.
- indicator-sma: GOLDEN_COLOR moved from imprint red to imprint amber
  (#DDCC77). The "golden cross" annotation no longer reads as a
  negative/loss signal.
- donut-nested: regenerated tonal shade lists for each family so the
  outer ring stays coherent with the new inner imprint base hex (the
  old Marketing/Sales shade lists mixed lavender with orange-pink
  tints from the previous palette and looked broken).
- windrose-basic: re-ordered speed bins so the intensity ramp is
  monotonically cool→warm again (blue → cyan → green → amber → red).
  Slot-1 lavender at the strongest bin had broken the legend
  ordering.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MarkusNeusinger MarkusNeusinger merged commit ba75688 into main May 27, 2026
7 checks passed
@MarkusNeusinger MarkusNeusinger deleted the chore/migrate-imprint-plotnine branch May 27, 2026 22:05
MarkusNeusinger added a commit that referenced this pull request May 27, 2026
## Summary

- Positional hex replacement across **139 plotly impls** with light+dark
renders → imprint. Mirrors #7776/#7779/#7780.
- Proactive semantic-anchor fixes for **13 plotly impls**
(red/amber/green where slot-1 lavender broke the meaning).

## Semantic fixes (proactive)

bar-diverging, candlestick-volume, gauge-basic (traffic-light),
indicator-ema (golden cross → amber), indicator-macd (signal → ochre for
contrast), indicator-rsi (overbought 70 → red), kagi-basic, ohlc-bar,
point-and-figure-basic, renko-basic, shap-waterfall, slope-basic,
waterfall-basic.

## Test plan

- [x] `ruff check .` + format green
- [ ] CI green
- [ ] Copilot triage
- [ ] After merge: Stage B for 139 plotly impls → GCS

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
MarkusNeusinger added a commit that referenced this pull request May 27, 2026
Positional hex + rgba replacement across 135 bokeh impls that already
ship light+dark renders. Mirrors PRs #7776/#7779/#7780/#7781.

Stage A now handles rgba(r,g,b,a) literals natively (added in #7781),
so the outline/fill mismatch class that bit the plotly PR doesn't
recur here.

Proactive semantic-anchor fixes for 13 bokeh impls where slot-1
(now lavender) or slot-5 (now red) carried explicit meaning:

- bar-diverging          BRAND_NEG       → red
- candlestick-volume     COLOR_DOWN      → red
- dashboard-metrics-tiles status warn→amber, critical→red, UNFAVORABLE→red
- gain-curve             SECONDARY       → blue (perfect-model reference)
- gauge-basic            ZONE_LOW/MID    → red/amber traffic-light
- horizon-basic          neg_colors      → warm-red ramp (light→mid→dark red)
- indicator-macd         HIST_NEGATIVE   → red
- kagi-basic             YIN_COLOR       → red
- point-and-figure-basic O_COLOR         → red
- renko-basic            BEARISH_COLOR   → red
- shap-waterfall         POS_COLOR       → red (vs blue NEG)
- slope-basic            DECREASE_COLOR  → red
- waterfall-basic        NEGATIVE        → red

Drive-by: add squarify to the [plotting] extra. It's required by
`plots/treemap-basic/implementations/python/seaborn.py` and was the
last spec to fail Stage B during the seaborn pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants