Skip to content

Commit 3d36f14

Browse files
authored
Merge pull request #4966 from plotly/merge-recent-docs-changes
Merge recent docs changes back to `master`
2 parents d831305 + 529c89d commit 3d36f14

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+448
-325
lines changed

doc/python/3d-axes.md

+16-3
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,22 @@ fig.add_trace(go.Mesh3d(x=(70*np.random.randn(N)),
159159
))
160160

161161
fig.update_layout(scene = dict(
162-
xaxis_title='X AXIS TITLE',
163-
yaxis_title='Y AXIS TITLE',
164-
zaxis_title='Z AXIS TITLE'),
162+
xaxis=dict(
163+
title=dict(
164+
text='X AXIS TITLE'
165+
)
166+
),
167+
yaxis=dict(
168+
title=dict(
169+
text='Y AXIS TITLE'
170+
)
171+
),
172+
zaxis=dict(
173+
title=dict(
174+
text='Z AXIS TITLE'
175+
)
176+
),
177+
),
165178
width=700,
166179
margin=dict(r=20, b=10, l=10, t=10))
167180

doc/python/3d-bubble-charts.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fig = go.Figure(data=go.Scatter3d(
7777

7878

7979
fig.update_layout(height=800, width=800,
80-
title='Examining Population and Life Expectancy Over Time')
80+
title=dict(text='Examining Population and Life Expectancy Over Time'))
8181

8282
fig.show()
8383
```
@@ -116,7 +116,7 @@ fig = go.Figure(data=go.Scatter3d(
116116
fig.update_layout(
117117
width=800,
118118
height=800,
119-
title="Planets!",
119+
title=dict(text="Planets!"),
120120
scene=dict(
121121
xaxis=dict(
122122
title=dict(
@@ -183,7 +183,7 @@ fig = go.Figure(go.Scatter3d(
183183
fig.update_layout(
184184
width=800,
185185
height=800,
186-
title="Planets!",
186+
title=dict(text="Planets!"),
187187
scene=dict(
188188
xaxis=dict(
189189
title=dict(

doc/python/3d-camera-controls.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/a
5353

5454
fig = go.Figure(data=go.Surface(z=z_data, showscale=False))
5555
fig.update_layout(
56-
title='Mt Bruno Elevation',
56+
title=dict(text='Mt Bruno Elevation'),
5757
width=400, height=400,
5858
margin=dict(t=40, r=0, l=20, b=20)
5959
)
@@ -85,7 +85,7 @@ z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/a
8585

8686
fig = go.Figure(data=go.Surface(z=z_data, showscale=False))
8787
fig.update_layout(
88-
title='Mt Bruno Elevation',
88+
title=dict(text='Mt Bruno Elevation'),
8989
width=400, height=400,
9090
margin=dict(t=30, r=0, l=20, b=10)
9191
)
@@ -112,7 +112,7 @@ z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/a
112112

113113
fig = go.Figure(data=go.Surface(z=z_data, showscale=False))
114114
fig.update_layout(
115-
title='Mt Bruno Elevation',
115+
title=dict(text='Mt Bruno Elevation'),
116116
width=400, height=400,
117117
margin=dict(t=30, r=0, l=20, b=10)
118118
)
@@ -138,7 +138,7 @@ z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/a
138138

139139
fig = go.Figure(data=go.Surface(z=z_data, showscale=False))
140140
fig.update_layout(
141-
title='Mt Bruno Elevation',
141+
title=dict(text='Mt Bruno Elevation'),
142142
width=400, height=400,
143143
margin=dict(t=30, r=0, l=20, b=10)
144144
)
@@ -163,7 +163,7 @@ z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/a
163163

164164
fig = go.Figure(data=go.Surface(z=z_data, showscale=False))
165165
fig.update_layout(
166-
title='Mt Bruno Elevation',
166+
title=dict(text='Mt Bruno Elevation'),
167167
width=400, height=400,
168168
margin=dict(t=30, r=0, l=20, b=10)
169169
)
@@ -189,7 +189,7 @@ z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/a
189189

190190
fig = go.Figure(data=go.Surface(z=z_data, showscale=False))
191191
fig.update_layout(
192-
title='Mt Bruno Elevation',
192+
title=dict(text='Mt Bruno Elevation'),
193193
width=400, height=400,
194194
margin=dict(t=30, r=0, l=20, b=10)
195195
)
@@ -216,7 +216,7 @@ z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/a
216216

217217
fig = go.Figure(data=go.Surface(z=z_data, showscale=False))
218218
fig.update_layout(
219-
title='Mt Bruno Elevation',
219+
title=dict(text='Mt Bruno Elevation'),
220220
width=400, height=400,
221221
margin=dict(t=30, r=0, l=20, b=10)
222222
)
@@ -243,7 +243,7 @@ z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/a
243243

244244
fig = go.Figure(data=go.Surface(z=z_data, showscale=False))
245245
fig.update_layout(
246-
title='Mt Bruno Elevation',
246+
title=dict(text='Mt Bruno Elevation'),
247247
width=400, height=400,
248248
margin=dict(t=30, r=0, l=20, b=10)
249249
)
@@ -273,7 +273,7 @@ z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/a
273273

274274
fig = go.Figure(data=go.Surface(z=z_data, showscale=False))
275275
fig.update_layout(
276-
title='Mt Bruno Elevation',
276+
title=dict(text='Mt Bruno Elevation'),
277277
width=400, height=400,
278278
margin=dict(t=25, r=0, l=20, b=30)
279279
)

doc/python/3d-mesh.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ fig = go.Figure(data=[
9797
x=[0, 1, 2, 0],
9898
y=[0, 0, 1, 2],
9999
z=[0, 2, 0, 1],
100-
colorbar_title='z',
100+
colorbar=dict(title=dict(text='z')),
101101
colorscale=[[0, 'gold'],
102102
[0.5, 'mediumturquoise'],
103103
[1, 'magenta']],
@@ -128,7 +128,7 @@ fig = go.Figure(data=[
128128
x=[0, 0, 1, 1, 0, 0, 1, 1],
129129
y=[0, 1, 1, 0, 0, 1, 1, 0],
130130
z=[0, 0, 0, 0, 1, 1, 1, 1],
131-
colorbar_title='z',
131+
colorbar=dict(title=dict(text='z')),
132132
colorscale=[[0, 'gold'],
133133
[0.5, 'mediumturquoise'],
134134
[1, 'magenta']],
@@ -160,7 +160,7 @@ fig = go.Figure(data=[
160160
x=[0, 0, 1, 1, 0, 0, 1, 1],
161161
y=[0, 1, 1, 0, 0, 1, 1, 0],
162162
z=[0, 0, 0, 0, 1, 1, 1, 1],
163-
colorbar_title='z',
163+
colorbar=dict(title=dict(text='z')),
164164
colorscale=[[0, 'gold'],
165165
[0.5, 'mediumturquoise'],
166166
[1, 'magenta']],

doc/python/3d-surface-plots.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/a
4646

4747
fig = go.Figure(data=[go.Surface(z=z_data.values)])
4848

49-
fig.update_layout(title='Mt Bruno Elevation', autosize=False,
49+
fig.update_layout(title=dict(text='Mt Bruno Elevation'), autosize=False,
5050
width=500, height=500,
5151
margin=dict(l=65, r=50, b=65, t=90))
5252

@@ -67,7 +67,7 @@ z = z_data.values
6767
sh_0, sh_1 = z.shape
6868
x, y = np.linspace(0, 1, sh_0), np.linspace(0, 1, sh_1)
6969
fig = go.Figure(data=[go.Surface(z=z, x=x, y=y)])
70-
fig.update_layout(title='Mt Bruno Elevation', autosize=False,
70+
fig.update_layout(title=dict(text='Mt Bruno Elevation'), autosize=False,
7171
width=500, height=500,
7272
margin=dict(l=65, r=50, b=65, t=90))
7373
fig.show()
@@ -90,7 +90,7 @@ z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/a
9090
fig = go.Figure(data=[go.Surface(z=z_data.values)])
9191
fig.update_traces(contours_z=dict(show=True, usecolormap=True,
9292
highlightcolor="limegreen", project_z=True))
93-
fig.update_layout(title='Mt Bruno Elevation', autosize=False,
93+
fig.update_layout(title=dict(text='Mt Bruno Elevation'), autosize=False,
9494
scene_camera_eye=dict(x=1.87, y=0.88, z=-0.64),
9595
width=500, height=500,
9696
margin=dict(l=65, r=50, b=65, t=90)

doc/python/animations.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jupyter:
3030
order: 1
3131
page_type: example_index
3232
permalink: python/animations/
33+
redirect_from: python/visualizing-mri-volume-slices/
3334
thumbnail: thumbnail/animations.gif
3435
---
3536

@@ -125,7 +126,7 @@ fig = go.Figure(
125126
layout=go.Layout(
126127
xaxis=dict(range=[0, 5], autorange=False),
127128
yaxis=dict(range=[0, 5], autorange=False),
128-
title="Start Title",
129+
title=dict(text="Start Title"),
129130
updatemenus=[dict(
130131
type="buttons",
131132
buttons=[dict(label="Play",
@@ -171,17 +172,17 @@ fig = go.Figure(
171172
fig.update_layout(width=600, height=450,
172173
xaxis=dict(range=[xm, xM], autorange=False, zeroline=False),
173174
yaxis=dict(range=[ym, yM], autorange=False, zeroline=False),
174-
title_text="Kinematic Generation of a Planar Curve", title_x=0.5,
175+
title_text="Kinematic Generation of a Planar Curve", title_x=0.5,
175176
updatemenus = [dict(type = "buttons",
176177
buttons = [
177178
dict(
178179
args = [None, {"frame": {"duration": 10, "redraw": False},
179180
"fromcurrent": True, "transition": {"duration": 10}}],
180181
label = "Play",
181182
method = "animate",
182-
183+
183184
)])])
184-
185+
185186
fig.update(frames=[go.Frame(
186187
data=[go.Scatter(
187188
x=[xx[k]],
@@ -239,7 +240,7 @@ fig = go.Figure(
239240
layout=go.Layout(width=600, height=600,
240241
xaxis=dict(range=[xm, xM], autorange=False, zeroline=False),
241242
yaxis=dict(range=[ym, yM], autorange=False, zeroline=False),
242-
title="Moving Frenet Frame Along a Planar Curve",
243+
title=dict(text="Moving Frenet Frame Along a Planar Curve"),
243244
hovermode="closest",
244245
updatemenus=[dict(type="buttons",
245246
buttons=[dict(label="Play",

doc/python/axes.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,8 @@ import plotly.express as px
649649
df = px.data.stocks(indexed=True)
650650

651651
fig = px.line(df, df.index, y="GOOG")
652-
fig.update_yaxes(ticklabelposition="inside", title="Price")
653-
fig.update_xaxes(insiderange=['2018-10-01', '2019-01-01'], title="Date")
652+
fig.update_yaxes(ticklabelposition="inside", title=dict(text="Price"))
653+
fig.update_xaxes(insiderange=['2018-10-01', '2019-01-01'], title=dict(text="Date"))
654654

655655
fig.show()
656656
```

doc/python/bar-charts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ fig.add_trace(go.Bar(x=years,
693693
))
694694

695695
fig.update_layout(
696-
title='US Export of Plastic Scrap',
696+
title=dict(text='US Export of Plastic Scrap'),
697697
xaxis_tickfont_size=14,
698698
yaxis=dict(
699699
title=dict(

doc/python/box-plots.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,10 @@ fig.add_trace(go.Box(
367367
))
368368

369369
fig.update_layout(
370-
yaxis_title='normalized moisture',
370+
yaxis=dict(
371+
title=dict(
372+
text='normalized moisture')
373+
),
371374
boxmode='group' # group together boxes of the different traces for each value of x
372375
)
373376
fig.show()
@@ -402,7 +405,7 @@ fig.add_trace(go.Box(
402405
))
403406

404407
fig.update_layout(
405-
xaxis=dict(title='normalized moisture', zeroline=False),
408+
xaxis=dict(title=dict(text='normalized moisture'), zeroline=False),
406409
boxmode='group'
407410
)
408411

@@ -479,7 +482,7 @@ for xd, yd, cls in zip(x_data, y_data, colors):
479482
)
480483

481484
fig.update_layout(
482-
title='Points Scored by the Top 9 Scoring NBA Players in 2012',
485+
title=dict(text='Points Scored by the Top 9 Scoring NBA Players in 2012'),
483486
yaxis=dict(
484487
autorange=True,
485488
showgrid=True,

doc/python/bubble-charts.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,15 @@ fig.update_traces(mode='markers', marker=dict(sizemode='area',
202202
sizeref=sizeref, line_width=2))
203203

204204
fig.update_layout(
205-
title='Life Expectancy v. Per Capita GDP, 2007',
205+
title=dict(text='Life Expectancy v. Per Capita GDP, 2007'),
206206
xaxis=dict(
207-
title='GDP per capita (2000 dollars)',
207+
title=dict(text='GDP per capita (2000 dollars)'),
208208
gridcolor='white',
209209
type='log',
210210
gridwidth=2,
211211
),
212212
yaxis=dict(
213-
title='Life Expectancy (years)',
213+
title=dict(text='Life Expectancy (years)'),
214214
gridcolor='white',
215215
gridwidth=2,
216216
),

doc/python/candlestick-charts.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,12 @@ fig = go.Figure(data=[go.Candlestick(x=df['Date'],
106106
])
107107

108108
fig.update_layout(
109-
title='The Great Recession',
110-
yaxis_title='AAPL Stock',
109+
title=dict(text='The Great Recession'),
110+
yaxis=dict(
111+
title=dict(
112+
text='AAPL Stock'
113+
)
114+
),
111115
shapes = [dict(
112116
x0='2016-12-09', x1='2016-12-09', y0=0, y1=1, xref='x', yref='paper',
113117
line_width=2)],

doc/python/choropleth-maps.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,11 @@ fig = go.Figure(data=go.Choropleth(
287287
autocolorscale=False,
288288
text=df['text'], # hover text
289289
marker_line_color='white', # line markers between states
290-
colorbar_title="Millions USD"
290+
colorbar=dict(
291+
title=dict(
292+
text="Millions USD"
293+
)
294+
)
291295
))
292296

293297
fig.update_layout(

doc/python/colorscales.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ df = px.data.tips()
246246
fig = px.density_heatmap(df, x="total_bill", y="tip", title="Customized color bar on this density plot")
247247

248248
fig.update_layout(coloraxis_colorbar=dict(
249-
title="Number of Bills per Cell",
249+
title=dict(text="Number of Bills per Cell"),
250250
thicknessmode="pixels", thickness=50,
251251
lenmode="pixels", len=200,
252252
yanchor="top", y=1,
@@ -271,7 +271,7 @@ fig = px.parallel_coordinates(df, dimensions=["sepal_length", "sepal_width", "pe
271271
(0.66, "blue"), (1.00, "blue")])
272272

273273
fig.update_layout(coloraxis_colorbar=dict(
274-
title="Species",
274+
title=dict(text="Species"),
275275
tickvals=[1,2,3],
276276
ticktext=["setosa","versicolor","virginica"],
277277
lenmode="pixels", len=100,
@@ -291,7 +291,7 @@ df = px.data.gapminder().query("year == 2007")
291291
fig = px.scatter(df, y="lifeExp", x="pop", color=np.log10(df["pop"]), hover_name="country", log_x=True)
292292

293293
fig.update_layout(coloraxis_colorbar=dict(
294-
title="Population",
294+
title=dict(text="Population"),
295295
tickvals=[6,7,8,9],
296296
ticktext=["1M", "10M", "100M", "1B"],
297297
))
@@ -408,7 +408,7 @@ fig.add_trace(go.Scatter(
408408
cmin=0,
409409
color=values,
410410
colorbar=dict(
411-
title="Colorbar"
411+
title=dict(text="Colorbar")
412412
),
413413
colorscale="Viridis"
414414
),
@@ -659,7 +659,7 @@ fig = go.Figure(go.Heatmap(
659659
colorbar=dict(
660660
x=0.2,
661661
xref="container",
662-
title="Surface Heat"
662+
title=dict(text="Surface Heat")
663663
)
664664
))
665665

doc/python/continuous-error-bars.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ fig = go.Figure([
108108
)
109109
])
110110
fig.update_layout(
111-
yaxis_title='Wind speed (m/s)',
112-
title='Continuous, variable value error bars',
111+
yaxis=dict(title=dict(text='Wind speed (m/s)')),
112+
title=dict(text='Continuous, variable value error bars'),
113113
hovermode="x"
114114
)
115115
fig.show()

doc/python/contour-plots.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ fig.add_trace(go.Contour(z=z, showscale=False, connectgaps=True), 1, 2)
153153
fig.add_trace(go.Heatmap(z=z, showscale=False, zsmooth='best'), 2, 1)
154154
fig.add_trace(go.Heatmap(z=z, showscale=False, connectgaps=True, zsmooth='best'), 2, 2)
155155

156-
fig['layout']['yaxis1'].update(title='Contour map')
157-
fig['layout']['yaxis3'].update(title='Heatmap')
156+
fig['layout']['yaxis1'].update(title=dict(text='Contour map'))
157+
fig['layout']['yaxis3'].update(title=dict(text='Heatmap'))
158158

159159
fig.show()
160160
```

0 commit comments

Comments
 (0)