Skip to content

Commit 21e99b7

Browse files
authored
Merge branch 'doc-prod' into update-5-15-examples
2 parents a3d540d + 0b64901 commit 21e99b7

File tree

4 files changed

+23
-15
lines changed

4 files changed

+23
-15
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ fig = px.scatter_3d(df, x='sepal_length', y='sepal_width', z='petal_width',
7070

7171
# tight layout
7272
fig.update_layout(margin=dict(l=0, r=0, b=0, t=0))
73+
fig.show()
7374
```
7475

7576
#### 3d scatter plots in Dash

doc/python/configuration-options.md

+19-10
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ import plotly.graph_objects as go
5353

5454
fig = go.Figure()
5555

56-
config = dict({'scrollZoom': True})
56+
config = {'scrollZoom': True}
5757

5858
fig.add_trace(
5959
go.Scatter(
@@ -244,6 +244,8 @@ fig.add_trace(
244244
y=[1, 3, 1]))
245245

246246
fig.update_layout(modebar_remove=['zoom', 'pan'])
247+
248+
fig.show()
247249
```
248250

249251
### Add optional shape-drawing buttons to modebar
@@ -253,16 +255,19 @@ fig.update_layout(modebar_remove=['zoom', 'pan'])
253255
Some modebar buttons of Cartesian plots are optional and have to be added explicitly, using the `modeBarButtonsToAdd` config attribute. These buttons are used for drawing or erasing shapes. See [the tutorial on shapes and shape drawing](python/shapes#drawing-shapes-on-cartesian-plots) for more details.
254256

255257
```python
256-
import plotly.graph_objects as go
257258
import plotly.express as px
259+
258260
df = px.data.iris()
261+
259262
fig = px.scatter(df, x='petal_width', y='sepal_length', color='species')
263+
260264
fig.update_layout(
261265
dragmode='drawopenpath',
262266
newshape_line_color='cyan',
263267
title_text='Draw a path to separate versicolor and virginica'
264268
)
265-
fig.show(config={'modeBarButtonsToAdd':['drawline',
269+
270+
fig.show(config={'modeBarButtonsToAdd': ['drawline',
266271
'drawopenpath',
267272
'drawclosedpath',
268273
'drawcircle',
@@ -276,10 +281,12 @@ fig.show(config={'modeBarButtonsToAdd':['drawline',
276281
The `layout.modebar.add` attribute can be used instead of the approach used above:
277282

278283
```python
279-
import plotly.graph_objects as go
280284
import plotly.express as px
285+
281286
df = px.data.iris()
287+
282288
fig = px.scatter(df, x='petal_width', y='sepal_length', color='species')
289+
283290
fig.update_layout(
284291
dragmode='drawopenpath',
285292
newshape_line_color='cyan',
@@ -292,6 +299,8 @@ fig.update_layout(
292299
'eraseshape'
293300
]
294301
)
302+
303+
fig.show()
295304
```
296305

297306
### Double-Click Delay
@@ -304,12 +313,12 @@ import plotly.graph_objects as go
304313
config = {'doubleClickDelay': 1000}
305314

306315
fig = go.Figure(go.Bar(
307-
y = [3, 5, 3, 2],
308-
x = ["2019-09-02", "2019-10-10", "2019-11-12", "2019-12-22"],
309-
texttemplate = "%{label}",
310-
textposition = "inside"))
316+
y=[3, 5, 3, 2],
317+
x=["2019-09-02", "2019-10-10", "2019-11-12", "2019-12-22"],
318+
texttemplate="%{label}",
319+
textposition="inside"))
311320

312-
fig.update_layout(xaxis = {'type': 'date'})
321+
fig.update_layout(xaxis={'type': 'date'})
313322

314323
fig.show(config=config)
315324
```
@@ -320,4 +329,4 @@ The same configuration dictionary that you pass to the `config` parameter of the
320329

321330
#### Reference
322331

323-
See config options at https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L6
332+
See config options at https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js

doc/python/figure-factory-subplots.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Y, X = np.meshgrid(x, y)
6161
u = -1 - X**2 + Y
6262
v = 1 + X - Y**2
6363

64-
fig2 = ff.create_streamline(x, y, u, v, arrow_scale=.1, name='Steamline')
64+
fig2 = ff.create_streamline(x, y, u, v, arrow_scale=.1, name='Streamline')
6565
```
6666

6767
Edit the figures' x and y axes attributes to create subplots:

doc/what_about_dash.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@ fig = go.Figure() # or any Plotly Express function e.g. px.bar(...)
1515
# fig.add_trace( ... )
1616
# fig.update_layout( ... )
1717

18-
import dash
19-
import dash_core_components as dcc
20-
import dash_html_components as html
18+
from dash import Dash, dcc, html
2119

22-
app = dash.Dash()
20+
app = Dash()
2321
app.layout = html.Div([
2422
dcc.Graph(figure=fig)
2523
])

0 commit comments

Comments
 (0)