Skip to content

Commit 8940b93

Browse files
committed
Update legend.md
1 parent c234bb1 commit 8940b93

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

doc/python/legend.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -199,18 +199,20 @@ Set the width of hozitonal legend entries by setting `entrywidth`. Here we set i
199199
import plotly.express as px
200200

201201
df = px.data.gapminder().query("year==2007")
202-
fig = px.scatter(df, x="gdpPercap", y="lifeExp", color="continent",
203-
size="pop", size_max=45, log_x=True)
204-
205-
fig.update_layout(legend=dict(
206-
orientation="h",
207-
entrywidth=70,
208-
yanchor="bottom",
209-
y=1.02,
210-
xanchor="right",
211-
x=1
212-
))
213-
202+
fig = px.scatter(
203+
df,
204+
x="gdpPercap",
205+
y="lifeExp",
206+
color="continent",
207+
size="pop",
208+
size_max=45,
209+
log_x=True,
210+
)
211+
fig.update_layout(
212+
legend=dict(
213+
orientation="h", entrywidth=70, yanchor="bottom", y=1.02, xanchor="right", x=1
214+
)
215+
)
214216
fig.show()
215217
```
216218

0 commit comments

Comments
 (0)