Skip to content

Commit 89b03a1

Browse files
committed
Merge branch 'master' into create_updating_figures
# Conflicts: # notebooks/user-guide.md
2 parents a82dd4c + 8baa329 commit 89b03a1

File tree

173 files changed

+1960
-2006
lines changed

Some content is hidden

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

173 files changed

+1960
-2006
lines changed

.github/pull_request_template.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Doc upgrade checklist:
2+
3+
- [ ] old boilerplate at top and bottom of file has been removed
4+
- [ ] Every example is independently runnable and is optimized for short line count
5+
- [ ] no more `plot()` or `iplot()`
6+
- [ ] `graph_objs` has been renamed to `graph_objects`
7+
- [ ] `fig = <something>` call is high up in each example
8+
- [ ] minimal creation of intermediate `trace` objects
9+
- [ ] liberal use of `add_trace` and `update_layout`
10+
- [ ] `fig.show()` at the end of each example
11+
- [ ] `px` example at the top if appropriate
12+
- [ ] `v4upgrade: true` metadata added
13+
- [ ] minimize usage of hex codes for colors in favour of those in https://github.com/plotly/plotly.py-docs/issues/14

notebooks/1d-correlation.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
jupyter:
33
jupytext:
4+
notebook_metadata_filter: all
45
text_representation:
56
extension: .md
67
format_name: markdown
@@ -164,4 +165,4 @@ publisher.publish(
164165

165166
```python
166167

167-
```
168+
```

notebooks/2D-Histogram.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
jupyter:
33
jupytext:
4+
notebook_metadata_filter: all
45
text_representation:
56
extension: .md
67
format_name: markdown
@@ -44,10 +45,10 @@ plotly.__version__
4445
### 2D Histogram with Slider Control ###
4546

4647

47-
Add slider controls to 2d histograms with the [postMessage API](https://github.com/plotly/postMessage-API).
48-
See the [code on JSFiddle](https://jsfiddle.net/plotlygraphs/y9sdy76h/4/).
49-
Watch [the 5 second video](https://raw.githubusercontent.com/plotly/documentation/gh-pages/all_static/images
50-
/flight_conflicts.gif) of how it works.
48+
Add slider controls to 2d histograms with the [postMessage API](https://github.com/plotly/postMessage-API).
49+
See the [code on JSFiddle](https://jsfiddle.net/plotlygraphs/y9sdy76h/4/).
50+
Watch [the 5 second video](https://raw.githubusercontent.com/plotly/documentation/gh-pages/all_static/images
51+
/flight_conflicts.gif) of how it works.
5152

5253
```python
5354
from IPython.core.display import display,HTML
@@ -181,11 +182,11 @@ publisher.publish(
181182
'How to make 2D Histograms in Python with Plotly.',
182183
title = 'Python 2D Histograms | plotly',
183184
name = '2D Histograms',
184-
has_thumbnail='true', thumbnail='thumbnail/histogram2d.jpg',
185+
has_thumbnail='true', thumbnail='thumbnail/histogram2d.jpg',
185186
language='python', display_as='statistical', order=6,
186-
ipynb= '~notebook_demo/24')
187+
ipynb= '~notebook_demo/24')
187188
```
188189

189190
```python
190191

191-
```
192+
```

notebooks/2d-histogram-contour.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
jupyter:
33
jupytext:
4+
notebook_metadata_filter: all
45
text_representation:
56
extension: .md
67
format_name: markdown
@@ -108,7 +109,7 @@ trace = [go.Histogram2dContour(
108109
color = 'black'
109110
)
110111
)
111-
112+
112113
)]
113114

114115
py.iplot(trace, filename = "Histogram2dContour Styled")
@@ -212,15 +213,15 @@ publisher.publish(
212213
'histogram2dcontour.ipynb', 'python/2d-histogram-contour/', '2D Histogram Contour',
213214
'How to make 2D Histogram Contour plots in Python with Plotly.',
214215
title = '2D Histogram Contour | Plotly',
215-
has_thumbnail='true', thumbnail='thumbnail/hist2dcontour.png',
216-
language='python',
216+
has_thumbnail='true', thumbnail='thumbnail/hist2dcontour.png',
217+
language='python',
217218
# page_type='example_index', // note this is only if you want the tutorial to appear on the main page: plot.ly/python
218-
display_as='statistical',
219-
order=30,
219+
display_as='statistical',
220+
order=30,
220221
ipynb='~notebook_demo/199',
221222
uses_plotly_offline=False)
222223
```
223224

224225
```python
225226

226-
```
227+
```

notebooks/2d-projection-of-3d-surface.md

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
jupyter:
33
jupytext:
4+
notebook_metadata_filter: all
45
text_representation:
56
extension: .md
67
format_name: markdown
@@ -95,14 +96,14 @@ trace1= go.Surface(
9596

9697
```python
9798
axis = dict(
98-
showbackground=True,
99-
backgroundcolor="rgb(230, 230,230)",
100-
showgrid=False,
101-
zeroline=False,
99+
showbackground=True,
100+
backgroundcolor="rgb(230, 230,230)",
101+
showgrid=False,
102+
zeroline=False,
102103
showline=False)
103104

104105
ztickvals=list(range(-6,4))
105-
layout = go.Layout(title="Projections of a surface onto coordinate planes" ,
106+
layout = go.Layout(title="Projections of a surface onto coordinate planes" ,
106107
autosize=False,
107108
width=700,
108109
height=600,
@@ -127,8 +128,8 @@ y_offset=np.min(yy)*np.ones(z.shape)
127128
```
128129

129130
Define the color functions and the color numpy arrays, `C_z`, `C_x`, `C_y`, corresponding to each plane:<br>
130-
Define the 3-tuples of coordinates to be displayed at hovering the mouse over the projections.
131-
The first two coordinates give the position in the projection plane, whereas the third one is used
131+
Define the 3-tuples of coordinates to be displayed at hovering the mouse over the projections.
132+
The first two coordinates give the position in the projection plane, whereas the third one is used
132133
for assigning the color, just in the same way the coordinate z is used for the z-direction projection.
133134

134135
```python
@@ -142,7 +143,7 @@ colorsurfy=proj_z(x,y,z)
142143
textx=[['y: '+'{:0.5f}'.format(y[i][j])+'<br>z: '+'{:0.5f}'.format(z[i][j])+
143144
'<br>x: '+'{:0.5f}'.format(x[i][j]) for j in range(z.shape[1])] for i in range(z.shape[0])]
144145
texty=[['x: '+'{:0.5f}'.format(x[i][j])+'<br>z: '+'{:0.5f}'.format(z[i][j]) +
145-
'<br>y: '+'{:0.5f}'.format(y[i][j]) for j in range(z.shape[1])] for i in range(z.shape[0])]
146+
'<br>y: '+'{:0.5f}'.format(y[i][j]) for j in range(z.shape[1])] for i in range(z.shape[0])]
146147

147148
tracex = go.Surface(z=list(z),
148149
x=list(x_offset),
@@ -193,12 +194,12 @@ publisher.publish(
193194
'Plotly-project-3d-onto-a-plane.ipynb', 'python/2d-projection-of-3d-surface/', 'Projection of 3D Surface',
194195
'How to project 3D Surface plots in 2D with Plotly.',
195196
title = '2D Projection of 3D surface | plotly',
196-
has_thumbnail='true', thumbnail='thumbnail/projection-3d.jpg',
197+
has_thumbnail='true', thumbnail='thumbnail/projection-3d.jpg',
197198
language='python',
198199
display_as='3d_charts', order=19,
199200
ipynb= '~notebook_demo/79')
200201
```
201202

202203
```python
203204

204-
```
205+
```

notebooks/3d-bubble-charts.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
jupyter:
33
jupytext:
4+
notebook_metadata_filter: all
45
text_representation:
56
extension: .md
67
format_name: markdown
@@ -96,7 +97,7 @@ trace1 = go.Scatter3d(
9697
sizeref = 750, # info on sizeref: https://plot.ly/python/reference/#scatter-marker-sizeref
9798
size = planet_diameter,
9899
color = planet_colors,
99-
)
100+
)
100101
)
101102
data=[trace1]
102103

@@ -143,7 +144,7 @@ trace1 = go.Scatter3d(
143144
color = temperatures,
144145
colorbar = dict(title = 'Mean<br>Temperature'),
145146
colorscale=[[0, 'rgb(5, 10, 172)'], [.3, 'rgb(255, 255, 255)'], [1, 'rgb(178, 10, 28)']]
146-
)
147+
)
147148
)
148149
data=[trace1]
149150

@@ -172,19 +173,19 @@ display(HTML('<link href="//fonts.googleapis.com/css?family=Open+Sans:600,400,30
172173
display(HTML('<link rel="stylesheet" type="text/css" href="http://help.plot.ly/documentation/all_static/css/ipython-notebook-custom.css">'))
173174

174175
! pip install git+https://github.com/plotly/publisher.git --upgrade
175-
176+
176177
import publisher
177178
publisher.publish(
178179
'3dbubble.ipynb', 'python/3d-bubble-charts/', 'Python 3D Bubble Charts',
179180
'How to make 3D Bubble Charts in Python with Plotly. '
180181
'Three examples of 3D Bubble Charts.',
181182
title = 'Python 3D Bubble Charts | plotly',
182183
name = '3D Bubble Charts',
183-
has_thumbnail='true', thumbnail='thumbnail/3dbubble.jpg',
184+
has_thumbnail='true', thumbnail='thumbnail/3dbubble.jpg',
184185
language='python', display_as='3d_charts', order=2,
185186
ipynb= '~notebook_demo/62')
186187
```
187188

188189
```python
189190

190-
```
191+
```

notebooks/3d-camera-controls.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
jupyter:
33
jupytext:
4+
notebook_metadata_filter: all
45
text_representation:
56
extension: .md
67
format_name: markdown
@@ -79,7 +80,7 @@ The up vector determines the up direction on the page. The default is $(x=0, y=0
7980

8081
The center vector determines the translation about the center of the scene. By default, there is no translation: the center vector is $(x=0, y=0, z=0)$.
8182

82-
The eye vector determines the camera view point about the origin. The default is $(x=1.25, y=1.25, z=1.25)$.
83+
The eye vector determines the camera view point about the origin. The default is $(x=1.25, y=1.25, z=1.25)$.
8384
<!-- #endregion -->
8485

8586
```python deletable=true editable=true
@@ -211,12 +212,12 @@ publisher.publish(
211212
'How to Control the Camera in your 3D Charts in Python with Plotly.',
212213
title= 'Python 3D Camera Controls | plotly',
213214
name = '3D Camera Controls',
214-
has_thumbnail='true', thumbnail='thumbnail/3d-camera-controls.jpg',
215-
language='python',
215+
has_thumbnail='true', thumbnail='thumbnail/3d-camera-controls.jpg',
216+
language='python',
216217
display_as='layout_opts', order=18,
217218
ipynb= '~notebook_demo/78')
218219
```
219220

220221
```python deletable=true editable=true
221222

222-
```
223+
```

notebooks/3d-filled-line-plots.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
jupyter:
33
jupytext:
4+
notebook_metadata_filter: all
45
text_representation:
56
extension: .md
67
format_name: markdown
@@ -58,7 +59,7 @@ for country, fill_color in zip(countries[::-1], fill_colors):
5859
country_coords = [country] * length
5960
pop = group['pop'].tolist()
6061
zeros = [0] * length
61-
62+
6263
data.append(dict(
6364
type='scatter3d',
6465
mode='lines',
@@ -117,12 +118,12 @@ publisher.publish(
117118
'How to make 3D Filled Line Plots in Python',
118119
title = '3D Filled Line Plots in Python | plotly',
119120
name = '3D Filled Line Plots',
120-
has_thumbnail='true', thumbnail='thumbnail/3d-filled-line-plot.jpg',
121+
has_thumbnail='true', thumbnail='thumbnail/3d-filled-line-plot.jpg',
121122
language='python',
122123
display_as='3d_charts', order=5,
123124
ipynb= '~notebook_demo/65')
124125
```
125126

126127
```python deletable=true editable=true
127128

128-
```
129+
```

notebooks/3d-isosurface-plots.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
jupyter:
33
jupytext:
4+
notebook_metadata_filter: all
45
text_representation:
56
extension: .md
67
format_name: markdown
@@ -161,20 +162,20 @@ display(HTML('<link href="//fonts.googleapis.com/css?family=Open+Sans:600,400,30
161162
display(HTML('<link rel="stylesheet" type="text/css" href="http://help.plot.ly/documentation/all_static/css/ipython-notebook-custom.css">'))
162163

163164
! pip install git+https://github.com/plotly/publisher.git --upgrade
164-
165+
165166
import publisher
166167
publisher.publish(
167168
'isosurfaces.ipynb', 'python/3d-isosurface-plots/', 'Iso Surface',
168169
'How to make 3D Isosurface Plots in Python with Plotly.',
169170
title = 'Python 3D Isosurface Plots | plotly',
170171
name = '3D Isosurface Plots',
171-
has_thumbnail='true', thumbnail='thumbnail/isosurface.jpg',
172+
has_thumbnail='true', thumbnail='thumbnail/isosurface.jpg',
172173
redirect_from='python/isosurfaces-with-marching-cubes/',
173174
language='python',
174175
display_as='3d_charts', order=12.1,
175-
ipynb= '~notebook_demo/272')
176+
ipynb= '~notebook_demo/272')
176177
```
177178

178179
```python
179180

180-
```
181+
```

notebooks/3d-line-plots.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
jupyter:
33
jupytext:
4+
notebook_metadata_filter: all
45
text_representation:
56
extension: .md
67
format_name: markdown
@@ -131,19 +132,19 @@ display(HTML('<link href="//fonts.googleapis.com/css?family=Open+Sans:600,400,30
131132
display(HTML('<link rel="stylesheet" type="text/css" href="http://help.plot.ly/documentation/all_static/css/ipython-notebook-custom.css">'))
132133

133134
! pip install git+https://github.com/plotly/publisher.git --upgrade
134-
135+
135136
import publisher
136137
publisher.publish(
137138
'3d-line.ipynb', 'python/3d-line-plots/', 'Python 3D Line Plots | plotly',
138139
'How to make 3D Line Plots',
139140
title= '3D Line Plots in Python | plotly',
140141
name = '3D Line Plots',
141-
has_thumbnail='true', thumbnail='thumbnail/3d-line.jpg',
142+
has_thumbnail='true', thumbnail='thumbnail/3d-line.jpg',
142143
language='python',
143144
display_as='3d_charts', order=3,
144145
ipynb= '~notebook_demo/63')
145146
```
146147

147148
```python
148149

149-
```
150+
```

notebooks/3d-network-graph.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
jupyter:
33
jupytext:
4+
notebook_metadata_filter: all
45
text_representation:
56
extension: .md
67
format_name: markdown
@@ -89,7 +90,7 @@ for node in data['nodes']:
8990
Get the node positions, set by the Kamada-Kawai layout for 3D graphs:
9091

9192
```python
92-
layt=G.layout('kk', dim=3)
93+
layt=G.layout('kk', dim=3)
9394
```
9495

9596
`layt` is a list of three elements lists (the coordinates of nodes):
@@ -109,8 +110,8 @@ Ye=[]
109110
Ze=[]
110111
for e in Edges:
111112
Xe+=[layt[e[0]][0],layt[e[1]][0], None]# x-coordinates of edge ends
112-
Ye+=[layt[e[0]][1],layt[e[1]][1], None]
113-
Ze+=[layt[e[0]][2],layt[e[1]][2], None]
113+
Ye+=[layt[e[0]][1],layt[e[1]][1], None]
114+
Ze+=[layt[e[0]][2],layt[e[1]][2], None]
114115
```
115116

116117
```python
@@ -203,12 +204,12 @@ publisher.publish(
203204
'How to make 3D Network Graphs in Python. ',
204205
title = '3D Network Graphs in Python | plotly',
205206
name = '3D Network Graphs',
206-
has_thumbnail='true', thumbnail='thumbnail/3dnetwork.jpg',
207-
language='python', page_type='example_index',
207+
has_thumbnail='true', thumbnail='thumbnail/3dnetwork.jpg',
208+
language='python', page_type='example_index',
208209
display_as='3d_charts', order=13,
209210
ipynb= '~notebook_demo/226')
210211
```
211212

212213
```python
213214

214-
```
215+
```

0 commit comments

Comments
 (0)