Skip to content

Fix dropdowns.md example #4023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions doc/python/dropdowns.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ jupyter:
text_representation:
extension: .md
format_name: markdown
format_version: '1.2'
jupytext_version: 1.3.2
format_version: '1.3'
jupytext_version: 1.14.1
kernelspec:
display_name: Python 3
display_name: Python 3 (ipykernel)
language: python
name: python3
language_info:
Expand All @@ -20,7 +20,7 @@ jupyter:
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
version: 3.7.3
version: 3.8.0
plotly:
description: How to add dropdowns to update Plotly chart attributes in Python.
display_as: controls
Expand Down Expand Up @@ -362,26 +362,26 @@ fig = go.Figure()
# Add Traces

fig.add_trace(
go.Scatter(x=list(df.index),
go.Scatter(x=list(df.Date),
y=list(df.High),
name="High",
line=dict(color="#33CFA5")))

fig.add_trace(
go.Scatter(x=list(df.index),
go.Scatter(x=list(df.Date),
y=[df.High.mean()] * len(df.index),
name="High Average",
visible=False,
line=dict(color="#33CFA5", dash="dash")))

fig.add_trace(
go.Scatter(x=list(df.index),
go.Scatter(x=list(df.Date),
y=list(df.Low),
name="Low",
line=dict(color="#F06A6A")))

fig.add_trace(
go.Scatter(x=list(df.index),
go.Scatter(x=list(df.Date),
y=[df.Low.mean()] * len(df.index),
name="Low Average",
visible=False,
Expand All @@ -393,17 +393,17 @@ high_annotations = [dict(x="2016-03-01",
xref="x", yref="y",
text="High Average:<br> %.3f" % df.High.mean(),
ax=0, ay=-40),
dict(x=df.High.idxmax(),
dict(x=df.Date[df.High.idxmax()],
y=df.High.max(),
xref="x", yref="y",
text="High Max:<br> %.3f" % df.High.max(),
ax=0, ay=-40)]
ax=-40, ay=-40)]
low_annotations = [dict(x="2015-05-01",
y=df.Low.mean(),
xref="x", yref="y",
text="Low Average:<br> %.3f" % df.Low.mean(),
ax=0, ay=40),
dict(x=df.High.idxmin(),
dict(x=df.Date[df.High.idxmin()],
y=df.Low.min(),
xref="x", yref="y",
text="Low Min:<br> %.3f" % df.Low.min(),
Expand Down