user13419531
user13419531

Reputation:

How to change Plotly Wind rose polar axis?

I created a Plotly windrose and wanted to change the inner circle limits to some other values(to get the same circle limit as my other wind roses). Here I want to change inner circle size to 0,2,4,6,8,10 to 0,2.5,5,7.5,10. Here is my code and my current windrose is already attached.

import plotly.express as px

df = px.data.wind()
fig = px.bar_polar(df, r="frequency", theta="direction",
                   color="strength", template="plotly_dark",
                   color_discrete_sequence=px.colors.sequential.Plasma_r)
fig.show()

enter image description here

Upvotes: 1

Views: 1140

Answers (1)

rpanai
rpanai

Reputation: 13437

This is not well documented but it has a similar behaviour of tickmode--array.

import plotly.express as px

df = px.data.wind()
fig = px.bar_polar(df, r="frequency", theta="direction",
                   color="strength", template="plotly_dark",
                   color_discrete_sequence= px.colors.sequential.Plasma_r)
fig.update_layout(
    polar=dict(
        radialaxis=dict(tickvals = [0, 2.5, 5, 7.5, 10])
    )
)
fig.show()

enter image description here

Upvotes: 1

Related Questions