Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f27f38f

Browse files
Merge pull request #5303 from plotly/add-missing-imports
Add missing imports and variable definitions (for main)
2 parents e693deb + 1e54e0c commit f27f38f

File tree

9 files changed

+16
-2
lines changed

9 files changed

+16
-2
lines changed

‎doc/python/3d-mesh.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ Whereas the previous example used the default `intensitymode='vertex'`, we plot
154154

155155
```python
156156
import plotly.graph_objects as go
157+
import numpy as np
158+
157159
fig = go.Figure(data=[
158160
go.Mesh3d(
159161
# 8 vertices of a cube

‎doc/python/axes.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ The PX `labels` argument can also be used without a data frame argument:
118118

119119
```python
120120
import plotly.express as px
121-
fig = px.bar(df, x=["Apples", "Oranges"], y=[10,20], color=["Here", "There"],
121+
fig = px.bar(x=["Apples", "Oranges"], y=[10,20], color=["Here", "There"],
122122
labels=dict(x="Fruit", y="Amount", color="Place")
123123
)
124124
fig.show()
@@ -460,6 +460,7 @@ Here, `ticklabelstandoff=15` moves the labels 15 pixels further away from the x-
460460

461461
```python
462462
import plotly.express as px
463+
import pandas as pd
463464

464465
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')
465466

@@ -487,6 +488,7 @@ To draw the label for the minor tick before each major tick, set `ticklabelindex
487488

488489
```python
489490
import plotly.express as px
491+
import pandas as pd
490492

491493
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')
492494

‎doc/python/box-plots.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ fig.show()
448448

449449
```python
450450
import plotly.graph_objects as go
451+
import numpy as np
451452

452453
x_data = ['Carmelo Anthony', 'Dwyane Wade',
453454
'Deron Williams', 'Brook Lopez',

‎doc/python/creating-and-updating-figures.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ fig.show()
206206
The `plotly.subplots.make_subplots()` function produces a graph object figure that is preconfigured with a grid of subplots that traces can be added to. The `add_trace()` function will be discussed more below.
207207

208208
```python
209+
import plotly.graph_objects as go
209210
from plotly.subplots import make_subplots
210211

211212
fig = make_subplots(rows=1, cols=2)
@@ -260,6 +261,7 @@ fig.show()
260261
If a figure was created using `plotly.subplots.make_subplots()`, then supplying the `row` and `col` arguments to `add_trace()` can be used to add a trace to a particular subplot.
261262

262263
```python
264+
import plotly.graph_objects as go
263265
from plotly.subplots import make_subplots
264266

265267
fig = make_subplots(rows=1, cols=2)
@@ -274,6 +276,7 @@ This also works for figures created by Plotly Express using the `facet_row` and
274276

275277
```python
276278
import plotly.express as px
279+
import plotly.graph_objects as go
277280

278281
df = px.data.iris()
279282

‎doc/python/imshow.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ fig.show()
274274
### Displaying an image and the histogram of color values
275275

276276
```python
277+
import plotly.graph_objects as go
277278
from plotly.subplots import make_subplots
278279
from skimage import data
279280
img = data.chelsea()

‎doc/python/network-graphs.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ node_trace.text = node_text
128128
#### Create Network Graph
129129

130130
```python
131+
import plotly.graph_objects as go
132+
131133
fig = go.Figure(data=[edge_trace, node_trace],
132134
layout=go.Layout(
133135
title=dict(

‎doc/python/ohlc-charts.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ import plotly.graph_objects as go
138138
import pandas as pd
139139
from datetime import datetime
140140

141+
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')
142+
141143
hovertext=[]
142144
for i in range(len(df['AAPL.Open'])):
143145
hovertext.append('Open: '+str(df['AAPL.Open'][i])+'<br>Close: '+str(df['AAPL.Close'][i]))

‎doc/python/templates.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ Combining themes is also supported by Plotly Express
389389

390390
```python
391391
import plotly.io as pio
392+
import plotly.graph_objects as go
392393
import plotly.express as px
393394

394395
pio.templates["draft"] = go.layout.Template(

‎doc/python/time-series.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ fig.show()
325325
```
326326

327327
```python
328-
import plotly.graph_objects as go
328+
import plotly.express as px
329329
import pandas as pd
330330
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')
331331

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /