You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/python/3d-surface-plots.md
+27-30Lines changed: 27 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -20,14 +20,14 @@ jupyter:
20
20
name: python
21
21
nbconvert_exporter: python
22
22
pygments_lexer: ipython3
23
-
version: 3.6.7
23
+
version: 3.7.3
24
24
plotly:
25
25
description: How to make 3D-surface plots in Python
26
26
display_as: 3d_charts
27
27
language: python
28
28
layout: base
29
29
name: 3D Surface Plots
30
-
order: 3
30
+
order: 6
31
31
page_type: example_index
32
32
permalink: python/3d-surface-plots/
33
33
thumbnail: thumbnail/3d-surface.jpg
@@ -52,6 +52,31 @@ fig.update_layout(title='Mt Bruno Elevation', autosize=False,
52
52
fig.show()
53
53
```
54
54
55
+
### Passing x and y data to 3D Surface Plot
56
+
57
+
If you do not specify `x` and `y` coordinates, integer indices are used for the `x` and `y` axis. You can also pass `x` and `y` values to `go.Surface`.
x, y = np.linspace(0, 1, sh_0), np.linspace(0, 1, sh_1)
70
+
71
+
fig = go.Figure(data=[go.Surface(z=z, x=x, y=y)])
72
+
73
+
fig.update_layout(title='Mt Bruno Elevation', autosize=False,
74
+
width=500, height=500,
75
+
margin=dict(l=65, r=50, b=65, t=90))
76
+
77
+
fig.show()
78
+
```
79
+
55
80
#### Surface Plot With Contours
56
81
57
82
@@ -76,35 +101,7 @@ fig.update_layout(title='Mt Bruno Elevation', autosize=False,
76
101
77
102
fig.show()
78
103
```
79
-
#### Configure Surface Contour Levels
80
-
This example shows how to slice the surface graph on the desired position for each of x, y and z axis. [contours.x.start](https://plot.ly/python/reference/#surface-contours-x-start) sets the starting contour level value, `end` sets the end of it, and `size` sets the step between each contour level.
0 commit comments