Skip to content

removed go.layout. in docs #2171

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
Feb 11, 2020
Merged
Show file tree
Hide file tree
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
32 changes: 16 additions & 16 deletions doc/python/custom-buttons.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ jupyter:
text_representation:
extension: .md
format_name: markdown
format_version: '1.1'
jupytext_version: 1.1.7
format_version: '1.2'
jupytext_version: 1.3.2
kernelspec:
display_name: Python 3
language: python
Expand All @@ -20,7 +20,7 @@ jupyter:
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
version: 3.7.2
version: 3.7.3
plotly:
description: How to add custom buttons to update Plotly chart attributes in Python.
display_as: controls
Expand Down Expand Up @@ -78,7 +78,7 @@ fig.update_scenes(
# Add dropdown
fig.update_layout(
updatemenus=[
go.layout.Updatemenu(
dict(
type = "buttons",
direction = "left",
buttons=list([
Expand Down Expand Up @@ -106,7 +106,7 @@ fig.update_layout(
# Add annotation
fig.update_layout(
annotations=[
go.layout.Annotation(text="Trace type:", showarrow=False,
dict(text="Trace type:", showarrow=False,
x=0, y=1.08, yref="paper", align="left")
]
)
Expand Down Expand Up @@ -153,7 +153,7 @@ button_layer_2_height = 1.065

fig.update_layout(
updatemenus=[
go.layout.Updatemenu(
dict(
buttons=list([
dict(
args=["colorscale", "Viridis"],
Expand Down Expand Up @@ -185,7 +185,7 @@ fig.update_layout(
y=button_layer_1_height,
yanchor="top"
),
go.layout.Updatemenu(
dict(
buttons=list([
dict(
args=["reversescale", False],
Expand All @@ -207,7 +207,7 @@ fig.update_layout(
y=button_layer_2_height,
yanchor="top"
),
go.layout.Updatemenu(
dict(
buttons=list([
dict(
args=[{"contours.showlines": False, "type": "contour"}],
Expand All @@ -234,11 +234,11 @@ fig.update_layout(

fig.update_layout(
annotations=[
go.layout.Annotation(text="colorscale", x=0, xref="paper", y=1.1, yref="paper",
dict(text="colorscale", x=0, xref="paper", y=1.1, yref="paper",
align="left", showarrow=False),
go.layout.Annotation(text="Reverse<br>Colorscale", x=0, xref="paper", y=1.06,
dict(text="Reverse<br>Colorscale", x=0, xref="paper", y=1.06,
yref="paper", showarrow=False),
go.layout.Annotation(text="Lines", x=0.47, xref="paper", y=1.045, yref="paper",
dict(text="Lines", x=0.47, xref="paper", y=1.045, yref="paper",
showarrow=False)
])

Expand Down Expand Up @@ -296,25 +296,25 @@ fig.add_trace(
)

# Add buttons that add shapes
cluster0 = [go.layout.Shape(type="circle",
cluster0 = [dict(type="circle",
xref="x", yref="y",
x0=min(x0), y0=min(y0),
x1=max(x0), y1=max(y0),
line=dict(color="DarkOrange"))]
cluster1 = [go.layout.Shape(type="circle",
cluster1 = [dict(type="circle",
xref="x", yref="y",
x0=min(x1), y0=min(y1),
x1=max(x1), y1=max(y1),
line=dict(color="Crimson"))]
cluster2 = [go.layout.Shape(type="circle",
cluster2 = [dict(type="circle",
xref="x", yref="y",
x0=min(x2), y0=min(y2),
x1=max(x2), y1=max(y2),
line=dict(color="RebeccaPurple"))]

fig.update_layout(
updatemenus=[
go.layout.Updatemenu(
dict(
type="buttons",
buttons=[
dict(label="None",
Expand Down Expand Up @@ -415,7 +415,7 @@ low_annotations = [dict(x="2015-05-01",

fig.update_layout(
updatemenus=[
go.layout.Updatemenu(
dict(
type="buttons",
direction="right",
active=0,
Expand Down
34 changes: 17 additions & 17 deletions doc/python/dropdowns.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ jupyter:
text_representation:
extension: .md
format_name: markdown
format_version: '1.1'
jupytext_version: 1.1.1
format_version: '1.2'
jupytext_version: 1.3.2
kernelspec:
display_name: Python 3
language: python
Expand All @@ -20,7 +20,7 @@ jupyter:
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
version: 3.6.7
version: 3.7.3
plotly:
description: How to add dropdowns to update Plotly chart attributes in Python.
display_as: controls
Expand Down Expand Up @@ -80,7 +80,7 @@ fig.update_scenes(
# Add dropdown
fig.update_layout(
updatemenus=[
go.layout.Updatemenu(
dict(
buttons=list([
dict(
args=["type", "surface"],
Expand All @@ -107,8 +107,8 @@ fig.update_layout(
# Add annotation
fig.update_layout(
annotations=[
go.layout.Annotation(text="Trace type:", showarrow=False,
x=0, y=1.085, yref="paper", align="left")
dict(text="Trace type:", showarrow=False,
x=0, y=1.085, yref="paper", align="left")
]
)

Expand Down Expand Up @@ -151,7 +151,7 @@ fig.update_scenes(
button_layer_1_height = 1.08
fig.update_layout(
updatemenus=[
go.layout.Updatemenu(
dict(
buttons=list([
dict(
args=["colorscale", "Viridis"],
Expand Down Expand Up @@ -182,7 +182,7 @@ fig.update_layout(
y=button_layer_1_height,
yanchor="top"
),
go.layout.Updatemenu(
dict(
buttons=list([
dict(
args=["reversescale", False],
Expand All @@ -203,7 +203,7 @@ fig.update_layout(
y=button_layer_1_height,
yanchor="top"
),
go.layout.Updatemenu(
dict(
buttons=list([
dict(
args=[{"contours.showlines": False, "type": "contour"}],
Expand All @@ -229,11 +229,11 @@ fig.update_layout(

fig.update_layout(
annotations=[
go.layout.Annotation(text="colorscale", x=0, xref="paper", y=1.06, yref="paper",
dict(text="colorscale", x=0, xref="paper", y=1.06, yref="paper",
align="left", showarrow=False),
go.layout.Annotation(text="Reverse<br>Colorscale", x=0.25, xref="paper", y=1.07,
dict(text="Reverse<br>Colorscale", x=0.25, xref="paper", y=1.07,
yref="paper", showarrow=False),
go.layout.Annotation(text="Lines", x=0.54, xref="paper", y=1.06, yref="paper",
dict(text="Lines", x=0.54, xref="paper", y=1.06, yref="paper",
showarrow=False)
])

Expand Down Expand Up @@ -293,25 +293,25 @@ fig.add_trace(
)

# Add buttons that add shapes
cluster0 = [go.layout.Shape(type="circle",
cluster0 = [dict(type="circle",
xref="x", yref="y",
x0=min(x0), y0=min(y0),
x1=max(x0), y1=max(y0),
line=dict(color="DarkOrange"))]
cluster1 = [go.layout.Shape(type="circle",
cluster1 = [dict(type="circle",
xref="x", yref="y",
x0=min(x1), y0=min(y1),
x1=max(x1), y1=max(y1),
line=dict(color="Crimson"))]
cluster2 = [go.layout.Shape(type="circle",
cluster2 = [dict(type="circle",
xref="x", yref="y",
x0=min(x2), y0=min(y2),
x1=max(x2), y1=max(y2),
line=dict(color="RebeccaPurple"))]

fig.update_layout(
updatemenus=[
go.layout.Updatemenu(buttons=list([
dict(buttons=list([
dict(label="None",
method="relayout",
args=["shapes", []]),
Expand Down Expand Up @@ -411,7 +411,7 @@ low_annotations = [dict(x="2015-05-01",

fig.update_layout(
updatemenus=[
go.layout.Updatemenu(
dict(
active=0,
buttons=list([
dict(label="None",
Expand Down
16 changes: 8 additions & 8 deletions doc/python/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ jupyter:
text_representation:
extension: .md
format_name: markdown
format_version: '1.1'
jupytext_version: 1.1.1
format_version: '1.2'
jupytext_version: 1.3.2
kernelspec:
display_name: Python 3
language: python
Expand Down Expand Up @@ -55,7 +55,7 @@ fig.add_trace(

# Add images
fig.add_layout_image(
go.layout.Image(
dict(
source="https://images.plot.ly/language-icons/api-home/python-logo.png",
xref="x",
yref="y",
Expand Down Expand Up @@ -178,12 +178,12 @@ for (x, y), n in zip(simulated_absorptions, names):

# Add images
fig.add_layout_image(
go.layout.Image(
dict(
source="https://raw.githubusercontent.com/michaelbabyn/plot_data/master/benzene.png",
x=0.75,
y=0.65,
))
fig.add_layout_image(go.layout.Image(
fig.add_layout_image(dict(
source="https://raw.githubusercontent.com/michaelbabyn/plot_data/master/naphthalene.png",
x=0.9,
y=0.3,
Expand All @@ -201,7 +201,7 @@ fig.update_layout_images(dict(
# Add annotations
fig.update_layout(
annotations=[
go.layout.Annotation(
dict(
x=93.0 / 300,
y=0.07 / 0.1,
xref="paper",
Expand All @@ -212,7 +212,7 @@ fig.update_layout(
ax=250,
ay=-40,
),
go.layout.Annotation(
dict(
x=156.0 / 300,
y=0.04 / 0.1,
xref="paper",
Expand Down Expand Up @@ -280,7 +280,7 @@ fig.update_yaxes(

# Add image
fig.add_layout_image(
go.layout.Image(
dict(
x=0,
sizex=img_width * scale_factor,
y=img_height * scale_factor,
Expand Down
2 changes: 1 addition & 1 deletion doc/python/lines-on-maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ for i in range(len(df_flight_paths)):
fig.update_layout(
title_text = 'Feb. 2011 American Airline flight paths<br>(Hover for airport names)',
showlegend = False,
geo = go.layout.Geo(
geo = dict(
scope = 'north america',
projection_type = 'azimuthal equal area',
showland = True,
Expand Down
2 changes: 1 addition & 1 deletion doc/python/mixed-subplots.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ fig.update_layout(
template="plotly_dark",
margin=dict(r=10, t=25, b=40, l=60),
annotations=[
go.layout.Annotation(
dict(
text="Source: NOAA",
showarrow=False,
xref="paper",
Expand Down
Loading