Skip to content
6 changes: 3 additions & 3 deletions plots/alluvial-basic/implementations/python/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"

# Okabe-Ito palette
OKABE_ITO = ["#009E73", "#D55E00", "#0072B2", "#CC79A7"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3", "#BD8233"]

# Data: Browser market share evolution 2015-2024
# Shows how different browsers have gained/lost market share over time
Expand All @@ -27,7 +27,7 @@

# Node labels and colors
node_labels = categories * 4
category_colors = {cat: OKABE_ITO[i] for i, cat in enumerate(categories)}
category_colors = {cat: IMPRINT[i] for i, cat in enumerate(categories)}
node_colors = [category_colors[cat] for cat in node_labels]

# X positions: 4 time points evenly spaced
Expand Down Expand Up @@ -85,7 +85,7 @@
targets.append(tgt_idx)
values.append(value)
# Use source category color with transparency
base_color = OKABE_ITO[src_cat]
base_color = IMPRINT[src_cat]
r = int(base_color[1:3], 16)
g = int(base_color[3:5], 16)
b = int(base_color[5:7], 16)
Expand Down
6 changes: 3 additions & 3 deletions plots/andrews-curves/implementations/python/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
INK_SOFT = "#4A4A44" if THEME == "light" else "#B8B7B0"
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"

OKABE_ITO = ["#009E73", "#D55E00", "#0072B2"]
BRAND = OKABE_ITO[0]
IMPRINT = ["#009E73", "#C475FD", "#4467A3"]
BRAND = IMPRINT[0]

# Data
iris = load_iris()
Expand Down Expand Up @@ -57,7 +57,7 @@
x=t,
y=curve,
mode="lines",
line=dict(color=OKABE_ITO[species_idx], width=2),
line=dict(color=IMPRINT[species_idx], width=2),
opacity=0.4,
name=species_names[species_idx],
legendgroup=species_names[species_idx],
Expand Down
14 changes: 7 additions & 7 deletions plots/area-cumulative-flow/implementations/python/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
ELEVATED_BG = "#FFFDF6" if THEME == "light" else "#242420"
INK = "#1A1A17" if THEME == "light" else "#F0EFE8"
INK_SOFT = "#4A4A44" if THEME == "light" else "#B8B7B0"
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"
GRID = "rgba(26, 26, 23, 0.10)" if THEME == "light" else "rgba(240, 239, 232, 0.10)"

# Okabe-Ito palette — first series is always #009E73
FILL_COLORS = [
"rgba(0,158,115,0.80)", # #009E73 Done
"rgba(213,94,0,0.80)", # #D55E00 Testing
"rgba(0,114,178,0.80)", # #0072B2 Development
"rgba(204,121,167,0.80)", # #CC79A7 Analysis
"rgba(230,159,0,0.80)", # #E69F00 Backlog
"rgba(0, 158, 115, 0.80)", # #009E73 Done
"rgba(196, 117, 253, 0.80)", # #C475FD Testing
"rgba(68, 103, 163, 0.80)", # #4467A3 Development
"rgba(189, 130, 51, 0.80)", # #BD8233 Analysis
"rgba(174, 48, 48, 0.80)", # #AE3030 Backlog
]
LINE_COLORS = ["#009E73", "#D55E00", "#0072B2", "#CC79A7", "#E69F00"]
LINE_COLORS = ["#009E73", "#C475FD", "#4467A3", "#BD8233", "#AE3030"]
Comment on lines 23 to +30

# Data — Kanban board for a software team over 90 days
np.random.seed(42)
Expand Down
20 changes: 10 additions & 10 deletions plots/area-stacked-confidence/implementations/python/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
ELEVATED_BG = "#FFFDF6" if THEME == "light" else "#242420"
INK = "#1A1A17" if THEME == "light" else "#F0EFE8"
INK_SOFT = "#4A4A44" if THEME == "light" else "#B8B7B0"
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"
GRID = "rgba(26, 26, 23, 0.10)" if THEME == "light" else "rgba(240, 239, 232, 0.10)"

# Okabe-Ito palette (positions 1-3 for three series)
HYDRO_COLOR = "#009E73" # Okabe-Ito position 1 (brand green)
WIND_COLOR = "#D55E00" # Okabe-Ito position 2 (vermillion)
SOLAR_COLOR = "#0072B2" # Okabe-Ito position 3 (blue)
WIND_COLOR = "#C475FD" # Okabe-Ito position 2 (vermillion)
SOLAR_COLOR = "#4467A3" # Okabe-Ito position 3 (blue)

# Data - Quarterly energy consumption forecast by source with uncertainty bands
np.random.seed(42)
Expand Down Expand Up @@ -67,7 +67,7 @@
y=list(hydro_upper_stack) + list(hydro_lower_stack[::-1]),
fill="toself",
fillcolor="rgba(0, 158, 115, 0.25)",
line=dict(color="rgba(255,255,255,0)"),
line=dict(color="rgba(255, 255, 255, 0)"),
showlegend=False,
name="Hydro Band",
hoverinfo="skip",
Expand All @@ -93,8 +93,8 @@
x=quarters + quarters[::-1],
y=list(wind_upper_stack) + list(wind_lower_stack[::-1]),
fill="toself",
fillcolor="rgba(213, 94, 0, 0.25)",
line=dict(color="rgba(255,255,255,0)"),
fillcolor="rgba(196, 117, 253, 0.25)",
line=dict(color="rgba(255, 255, 255, 0)"),
showlegend=False,
name="Wind Band",
hoverinfo="skip",
Expand All @@ -110,7 +110,7 @@
line=dict(color=WIND_COLOR, width=3),
name="Wind",
fill="tonexty",
fillcolor="rgba(213, 94, 0, 0.6)",
fillcolor="rgba(196, 117, 253, 0.6)",
)
)

Expand All @@ -120,8 +120,8 @@
x=quarters + quarters[::-1],
y=list(solar_upper_stack) + list(solar_lower_stack[::-1]),
fill="toself",
fillcolor="rgba(0, 114, 178, 0.25)",
line=dict(color="rgba(255,255,255,0)"),
fillcolor="rgba(68, 103, 163, 0.25)",
line=dict(color="rgba(255, 255, 255, 0)"),
showlegend=False,
name="Solar Band",
hoverinfo="skip",
Expand All @@ -137,7 +137,7 @@
line=dict(color=SOLAR_COLOR, width=3),
name="Solar",
fill="tonexty",
fillcolor="rgba(0, 114, 178, 0.6)",
fillcolor="rgba(68, 103, 163, 0.6)",
)
)

Expand Down
18 changes: 9 additions & 9 deletions plots/area-stacked/implementations/python/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"

# Okabe-Ito palette (first series is always brand green)
OKABE_ITO = ["#009E73", "#D55E00", "#0072B2", "#CC79A7"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3", "#BD8233"]

# Data - Monthly revenue by product category over 2 years
np.random.seed(42)
Expand Down Expand Up @@ -48,9 +48,9 @@
y=software,
name="Software",
mode="lines",
line=dict(width=0.5, color=OKABE_ITO[0]),
line=dict(width=0.5, color=IMPRINT[0]),
fill="tozeroy",
fillcolor=OKABE_ITO[0],
fillcolor=IMPRINT[0],
stackgroup="one",
hovertemplate="<b>Software</b><br>%{x|%b %Y}<br>Revenue: $%{y:,.0f}<extra></extra>",
)
Expand All @@ -62,9 +62,9 @@
y=services,
name="Services",
mode="lines",
line=dict(width=0.5, color=OKABE_ITO[1]),
line=dict(width=0.5, color=IMPRINT[1]),
fill="tonexty",
fillcolor=OKABE_ITO[1],
fillcolor=IMPRINT[1],
stackgroup="one",
hovertemplate="<b>Services</b><br>%{x|%b %Y}<br>Revenue: $%{y:,.0f}<extra></extra>",
)
Expand All @@ -76,9 +76,9 @@
y=enterprise,
name="Enterprise",
mode="lines",
line=dict(width=0.5, color=OKABE_ITO[2]),
line=dict(width=0.5, color=IMPRINT[2]),
fill="tonexty",
fillcolor=OKABE_ITO[2],
fillcolor=IMPRINT[2],
stackgroup="one",
hovertemplate="<b>Enterprise</b><br>%{x|%b %Y}<br>Revenue: $%{y:,.0f}<extra></extra>",
)
Expand All @@ -90,9 +90,9 @@
y=consulting,
name="Consulting",
mode="lines",
line=dict(width=0.5, color=OKABE_ITO[3]),
line=dict(width=0.5, color=IMPRINT[3]),
fill="tonexty",
fillcolor=OKABE_ITO[3],
fillcolor=IMPRINT[3],
stackgroup="one",
hovertemplate="<b>Consulting</b><br>%{x|%b %Y}<br>Revenue: $%{y:,.0f}<extra></extra>",
)
Expand Down
4 changes: 2 additions & 2 deletions plots/bar-3d-categorical/implementations/python/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
INK_SOFT = "#4A4A44" if THEME == "light" else "#B8B7B0"
GRID_COLOR = "#D0CEC7" if THEME == "light" else "#2D2D2A"

OKABE_ITO = ["#009E73", "#D55E00", "#0072B2", "#CC79A7"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3", "#BD8233"]

# Data
np.random.seed(42)
Expand Down Expand Up @@ -64,7 +64,7 @@
i=ii,
j=jj,
k=kk,
color=OKABE_ITO[p_idx],
color=IMPRINT[p_idx],
opacity=1.0,
name=prod,
showlegend=True,
Expand Down
2 changes: 1 addition & 1 deletion plots/bar-diverging/implementations/python/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

# Okabe-Ito palette: position 1 (green) for positive, position 2 (orange) for negative
POSITIVE_COLOR = "#009E73"
NEGATIVE_COLOR = "#D55E00"
NEGATIVE_COLOR = "#AE3030" # imprint red — semantic negative

# Data: Customer satisfaction survey results by department
# Scores range from -100 (very dissatisfied) to +100 (very satisfied)
Expand Down
2 changes: 1 addition & 1 deletion plots/bar-drilldown/implementations/python/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"

# anyplot palette — positions 1–4 for 4 quarters
PALETTE = ["#009E73", "#9418DB", "#B71D27", "#16B8F3"]
PALETTE = ["#009E73", "#C475FD", "#AE3030", "#4467A3"]

# Data: 2024 Retail Sales — quarter → month two-level hierarchy
QUARTERS = [
Expand Down
2 changes: 1 addition & 1 deletion plots/bar-grouped/implementations/python/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
GRID = "rgba(26,26,23,0.20)" if THEME == "light" else "rgba(240,239,232,0.20)"

# Okabe-Ito palette
COLORS = ["#009E73", "#D55E00", "#0072B2"]
COLORS = ["#009E73", "#C475FD", "#4467A3"]

# Data: Quarterly revenue by product line
categories = ["Q1", "Q2", "Q3", "Q4"]
Expand Down
4 changes: 2 additions & 2 deletions plots/bar-race-animated/implementations/python/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
INK_SOFT = "#4A4A44" if THEME == "light" else "#B8B7B0"
GRID = "rgba(26,26,23,0.25)" if THEME == "light" else "rgba(240,239,232,0.25)"

OKABE_ITO = ["#009E73", "#D55E00", "#0072B2", "#CC79A7", "#E69F00", "#56B4E9", "#F0E442"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3", "#BD8233", "#AE3030", "#2ABCCD", "#954477"]

# Data: Major economy GDP rankings (approximate, in trillion USD, 1995–2023)
np.random.seed(42)
Expand All @@ -27,7 +27,7 @@
years = list(range(1995, 2024))

base_gdp = {"USA": 7.70, "China": 0.73, "Japan": 5.45, "Germany": 2.60, "UK": 1.28, "France": 1.60, "Brazil": 0.77}
color_map = dict(zip(countries, OKABE_ITO))
color_map = dict(zip(countries, IMPRINT))

data_rows = []
for country in countries:
Expand Down
4 changes: 2 additions & 2 deletions plots/bar-spine/implementations/python/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
# Conditional proportions within each bar (heights sum to 1)
outcome_props = {k: [cnt / m for cnt, m in zip(v, channel_sizes)] for k, v in outcome_counts.items()}

# Okabe-Ito palette: Active=green(1), On Trial=orange(5), Cancelled=vermillion(2)
COLORS = {"Active": "#009E73", "On Trial": "#E69F00", "Cancelled": "#D55E00"}
# imprint semantic anchors: Active=green, On Trial=amber (warning), Cancelled=red (bad)
COLORS = {"Active": "#009E73", "On Trial": "#DDCC77", "Cancelled": "#AE3030"}

# Plot
fig = go.Figure()
Expand Down
4 changes: 2 additions & 2 deletions plots/bar-stacked-labeled/implementations/python/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"

# Okabe-Ito palette (first series is ALWAYS #009E73)
OKABE_ITO = ["#009E73", "#D55E00", "#0072B2", "#CC79A7"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3", "#BD8233"]

# Data: Quarterly revenue by product category
quarters = ["Q1 2024", "Q2 2024", "Q3 2024", "Q4 2024", "Q1 2025"]
Expand All @@ -43,7 +43,7 @@
fig = go.Figure()

# Add stacked bars for each product
for product, color in zip(products, OKABE_ITO, strict=True):
for product, color in zip(products, IMPRINT, strict=True):
fig.add_trace(
go.Bar(
name=product,
Expand Down
4 changes: 2 additions & 2 deletions plots/bar-stacked-percent/implementations/python/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"

# Okabe-Ito palette - first color is always #009E73
OKABE_ITO = ["#009E73", "#D55E00", "#0072B2", "#CC79A7", "#E69F00"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3", "#BD8233", "#AE3030"]

# Data: Smartphone OS market share across world regions
categories = ["North America", "South America", "Europe", "Africa", "Asia"]
Expand All @@ -45,7 +45,7 @@
name=component,
x=categories,
y=df[component].values,
marker=dict(color=OKABE_ITO[i], line=dict(width=0)),
marker=dict(color=IMPRINT[i], line=dict(width=0)),
text=[f"{v:.0f}%" for v in df[component].values],
textposition="inside",
textfont=dict(size=16, color="white"),
Expand Down
2 changes: 1 addition & 1 deletion plots/bar-stacked/implementations/python/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
GRID_SUBTLE = "rgba(26,26,23,0.04)" if THEME == "light" else "rgba(240,239,232,0.04)"

# Okabe-Ito palette (first series always #009E73)
COLORS = ["#009E73", "#D55E00", "#0072B2", "#CC79A7"]
COLORS = ["#009E73", "#C475FD", "#4467A3", "#BD8233"]

# Data - Quarterly revenue by product category
quarters = ["Q1 2024", "Q2 2024", "Q3 2024", "Q4 2024"]
Expand Down
4 changes: 2 additions & 2 deletions plots/biplot-pca/implementations/python/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"

# Okabe-Ito palette (first series is always #009E73)
OKABE_ITO = ["#009E73", "#D55E00", "#0072B2"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3"]

# Load data
iris = load_iris()
Expand Down Expand Up @@ -52,7 +52,7 @@
x=scores[mask, 0],
y=scores[mask, 1],
mode="markers",
marker={"size": 14, "color": OKABE_ITO[i], "opacity": 0.8, "line": {"width": 1, "color": PAGE_BG}},
marker={"size": 14, "color": IMPRINT[i], "opacity": 0.8, "line": {"width": 1, "color": PAGE_BG}},
name=target.capitalize(),
legendgroup=target,
)
Expand Down
2 changes: 1 addition & 1 deletion plots/bland-altman-basic/implementations/python/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"

BRAND = "#009E73"
ACCENT = "#D55E00"
ACCENT = "#C475FD"

# Data - Glucose meter readings comparison (medical device validation)
np.random.seed(73)
Expand Down
4 changes: 2 additions & 2 deletions plots/box-grouped/implementations/python/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"

# Okabe-Ito palette
OKABE_ITO = ["#009E73", "#D55E00", "#0072B2"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3"]

# Data - Employee performance scores by department and experience level
np.random.seed(42)
Expand Down Expand Up @@ -73,7 +73,7 @@
x=x_vals,
y=y_vals,
name=subcat,
marker_color=OKABE_ITO[i],
marker_color=IMPRINT[i],
boxmean=False,
line={"width": 2},
marker={"size": 8, "opacity": 0.7},
Expand Down
8 changes: 4 additions & 4 deletions plots/box-horizontal/implementations/python/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
INK_SOFT = "#4A4A44" if THEME == "light" else "#B8B7B0"
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"

OKABE_ITO = ["#009E73", "#D55E00", "#0072B2", "#CC79A7", "#E69F00", "#56B4E9"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3", "#BD8233", "#AE3030", "#2ABCCD"]

# Data - Response times (ms) by service type
np.random.seed(42)
Expand Down Expand Up @@ -64,9 +64,9 @@
x=service_data,
name=service,
orientation="h",
marker=dict(color=OKABE_ITO[i % len(OKABE_ITO)], size=8, outliercolor=OKABE_ITO[i % len(OKABE_ITO)]),
line=dict(color=OKABE_ITO[i % len(OKABE_ITO)], width=2),
fillcolor=OKABE_ITO[i % len(OKABE_ITO)],
marker=dict(color=IMPRINT[i % len(IMPRINT)], size=8, outliercolor=IMPRINT[i % len(IMPRINT)]),
line=dict(color=IMPRINT[i % len(IMPRINT)], width=2),
fillcolor=IMPRINT[i % len(IMPRINT)],
opacity=0.7,
boxmean=False,
hovertemplate="<b>%{name}</b><br>Value: %{x:.1f} ms<extra></extra>",
Expand Down
Loading
Loading