Skip to content

Commit ae1ecc9

Browse files
committed
Update cone-plot.md
1 parent 09404d9 commit ae1ecc9

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

doc/python/cone-plot.md

+34-1
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,41 @@ fig.show()
128128

129129
### Sizemode
130130

131-
Earlier examples use `sizemode="absolute"` when adjusting the cone size scaling with `sizeref`. `sizemode` also supports `raw`(new in 5.21) and `scaled`. For more details, see the [Cone Sizemode](https://plotly.com/python/reference/cone/#cone-sizemode) and https://plotly.com/python/reference/cone/#cone and [Cone Sizeref](https://plotly.com/python/reference/cone/#cone-sizeref) reference documentation.
131+
Earlier examples use `sizemode="absolute"` when adjusting the cone size scaling with `sizeref`. `sizemode` also supports `raw`(new in 5.21) and `scaled`.
132132

133+
```python
134+
import plotly.graph_objects as go
135+
import pandas as pd
136+
137+
df = pd.read_csv(
138+
"https://raw.githubusercontent.com/plotly/datasets/master/cone_plot_data.csv"
139+
)
140+
141+
fig = go.Figure(
142+
data=go.Cone(
143+
x=df["x"],
144+
y=df["y"],
145+
z=df["z"],
146+
u=df["u"],
147+
v=df["v"],
148+
w=df["w"],
149+
sizemode="raw",
150+
sizeref=0.1,
151+
colorscale="Portland",
152+
cmin=0,
153+
cmax=80,
154+
hoverinfo="u+v+w+text",
155+
text="-> wind <-",
156+
),
157+
layout=dict(
158+
width=900, height=600, scene=dict(camera=dict(eye=dict(x=1.2, y=0, z=0.6)))
159+
),
160+
)
161+
162+
163+
fig.show()
164+
165+
```
133166

134167
#### Reference
135168
See https://plotly.com/python/reference/ for more information and chart attribute options!

0 commit comments

Comments
 (0)