Skip to content

Commit 4ce93be

Browse files
fix(plotly): address review feedback for scatter-marginal
Attempt 1/3 - improved design excellence: - Thinner grid (0.5px) for publication-grade refinement - Cleaned up axes with explicit spine control (bottom/left only) - Removed grids from marginal distribution axes - Added hover tooltips for enhanced data storytelling - Theme-adaptive styling maintains perfect dark/light separation - Stronger visual hierarchy with subtle grid and clean spines
1 parent 1431846 commit 4ce93be

1 file changed

Lines changed: 25 additions & 6 deletions

File tree

  • plots/scatter-marginal/implementations/python

plots/scatter-marginal/implementations/python/plotly.py

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" anyplot.ai
1+
"""anyplot.ai
22
scatter-marginal: Scatter Plot with Marginal Distributions
33
Library: plotly 6.7.0 | Python 3.13.13
44
Quality: 88/100 | Updated: 2026-05-09
@@ -77,7 +77,13 @@
7777
)
7878
)
7979

80-
# Update layout
80+
# Enhanced hover tooltips for better data storytelling
81+
fig.update_traces(
82+
hovertemplate="<b>Measurement</b><br>Temperature: %{x:.1f}°C<br>Humidity: %{y:.1f}%<extra></extra>",
83+
selector=dict(mode="markers"),
84+
)
85+
86+
# Update layout with refined design: spine removal, subtle grid, publication-grade styling
8187
fig.update_layout(
8288
title=dict(text="scatter-marginal · plotly · anyplot.ai", font=dict(size=28, color=INK), x=0.5, xanchor="center"),
8389
xaxis=dict(
@@ -87,7 +93,11 @@
8793
gridcolor=GRID,
8894
linecolor=INK_SOFT,
8995
showgrid=True,
90-
gridwidth=1,
96+
gridwidth=0.5,
97+
showline=True,
98+
linewidth=1.5,
99+
mirror=False,
100+
side="bottom",
91101
),
92102
yaxis=dict(
93103
domain=[0, 0.85],
@@ -96,17 +106,26 @@
96106
gridcolor=GRID,
97107
linecolor=INK_SOFT,
98108
showgrid=True,
99-
gridwidth=1,
109+
gridwidth=0.5,
110+
showline=True,
111+
linewidth=1.5,
112+
mirror=False,
113+
side="left",
114+
),
115+
xaxis2=dict(
116+
domain=[0.85, 1], showticklabels=False, gridcolor=GRID, linecolor=INK_SOFT, showgrid=False, showline=False
117+
),
118+
yaxis2=dict(
119+
domain=[0.85, 1], showticklabels=False, gridcolor=GRID, linecolor=INK_SOFT, showgrid=False, showline=False
100120
),
101-
xaxis2=dict(domain=[0.85, 1], showticklabels=False, gridcolor=GRID, linecolor=INK_SOFT),
102-
yaxis2=dict(domain=[0.85, 1], showticklabels=False, gridcolor=GRID, linecolor=INK_SOFT),
103121
paper_bgcolor=PAGE_BG,
104122
plot_bgcolor=PAGE_BG,
105123
font=dict(family="Arial, sans-serif", color=INK),
106124
showlegend=False,
107125
margin=dict(l=120, r=80, t=100, b=100),
108126
height=900,
109127
width=1600,
128+
hovermode="closest",
110129
)
111130

112131
# Save

0 commit comments

Comments
 (0)