Is there a way to add additional degrees in windrose(default degrees marked as every 45° )? what I want to do is, mark degrees at every 22.5° instead of every 45°(0°,22.5°,45°,67.5° and so on).
I read the plotly windrose documentation, but couldn’t able to find a suitable way to fix this.
code:
JavaScript
x
9
1
fig = px.bar_polar(df, r="Frequency", theta="wind_dir_Range",
2
color="Wind_Speed",
3
color_discrete_map={"0-10 km/h": "purple", "10-20 km/h": "cyan","20-30 km/h":"limegreen","30-40 km/h": "red"}
4
5
)
6
7
8
fig.show()
9
Advertisement
Answer
- have used alternate source of data… doesn’t generate a good chart
- however it does show that you can adjust tick size using dtick
JavaScript
1
9
1
import plotly.express as px
2
df = px.data.wind()
3
df = df.assign(Direction=np.random.uniform(0,360,len(df)))
4
5
fig = px.bar_polar(df, r="frequency", theta="Direction",
6
color="strength", template="plotly_dark",
7
color_discrete_sequence= px.colors.sequential.Plasma_r)
8
fig.update_layout(polar={"angularaxis":{"dtick":45/2}})
9