Skip to content

Commit

Permalink
Update cone-plot.md
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamConnors committed Apr 15, 2024
1 parent 09404d9 commit ae1ecc9
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion doc/python/cone-plot.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,41 @@ fig.show()

### Sizemode

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.
Earlier examples use `sizemode="absolute"` when adjusting the cone size scaling with `sizeref`. `sizemode` also supports `raw`(new in 5.21) and `scaled`.

```python
import plotly.graph_objects as go
import pandas as pd

df = pd.read_csv(
"https://raw.githubusercontent.com/plotly/datasets/master/cone_plot_data.csv"
)

fig = go.Figure(
data=go.Cone(
x=df["x"],
y=df["y"],
z=df["z"],
u=df["u"],
v=df["v"],
w=df["w"],
sizemode="raw",
sizeref=0.1,
colorscale="Portland",
cmin=0,
cmax=80,
hoverinfo="u+v+w+text",
text="-> wind <-",
),
layout=dict(
width=900, height=600, scene=dict(camera=dict(eye=dict(x=1.2, y=0, z=0.6)))
),
)


fig.show()

```

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

0 comments on commit ae1ecc9

Please sign in to comment.