Skip to content

Commit 1d7c1c0

Browse files
committed
removed calls to go.Layout or go.layout.XAxis
1 parent b83aaef commit 1d7c1c0

File tree

1 file changed

+11
-21
lines changed

1 file changed

+11
-21
lines changed

doc/python/axes.md

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: "1.1"
9-
jupytext_version: 1.2.1
8+
format_version: '1.2'
9+
jupytext_version: 1.3.0
1010
kernelspec:
1111
display_name: Python 3
1212
language: python
@@ -22,8 +22,7 @@ jupyter:
2222
pygments_lexer: ipython3
2323
version: 3.7.3
2424
plotly:
25-
description:
26-
How to adjust axes properties in python. Includes examples of linear
25+
description: How to adjust axes properties in python. Includes examples of linear
2726
and logarithmic axes, axes titles, styling and coloring axes and grid lines,
2827
and more.
2928
display_as: file_settings
@@ -48,14 +47,8 @@ Here is an example of setting `showgrid` to `False` in the graph object figure c
4847
```python
4948
import plotly.graph_objects as go
5049

51-
fig = go.Figure(
52-
data=[go.Scatter(y=[1, 0])],
53-
layout=go.Layout(
54-
xaxis=dict(showgrid=False),
55-
yaxis=dict(showgrid=False),
56-
)
57-
)
58-
50+
fig = go.Figure(go.Scatter(y=[1, 0]))
51+
fig.update_layout(xaxis_showgrid=False, yaxis_showgrid=False)
5952
fig.show()
6053
```
6154

@@ -66,14 +59,11 @@ The lines passing through zero can be disabled as well by setting the `zeroline`
6659
```python
6760
import plotly.graph_objects as go
6861

69-
fig = go.Figure(
70-
data=[go.Scatter(y=[1, 0])],
71-
layout=go.Layout(
72-
xaxis=dict(showgrid=False, zeroline=False),
73-
yaxis=dict(showgrid=False, zeroline=False),
74-
)
62+
fig = go.Figure(go.Scatter(y=[1, 0]))
63+
fig.update_layout(
64+
xaxis=dict(showgrid=False, zeroline=False),
65+
yaxis=dict(showgrid=False, zeroline=False),
7566
)
76-
7767
fig.show()
7868
```
7969

@@ -246,12 +236,12 @@ fig = go.Figure(go.Scatter(
246236
x = ["December", "January", "February"]))
247237

248238
fig.update_layout(
249-
xaxis = go.layout.XAxis(
239+
xaxis = dict(
250240
tickangle = 90,
251241
title_text = "Month",
252242
title_font = {"size": 20},
253243
title_standoff = 25),
254-
yaxis = go.layout.YAxis(
244+
yaxis = dict(
255245
title_text = "Temperature",
256246
title_standoff = 25))
257247

0 commit comments

Comments
 (0)