我有一个极坐标条形图,图中有堆叠条形图,它也使用我添加的代码给出了下图(示例在这里找到:Wind Rode Charts):
import plotly.io as pio
pio.renderers.default = 'svg'
#pio.renderers.default = 'browser'
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
df = px.data.wind()
fig = px.bar_polar(df, r="frequency", theta="direction",
color="strength", template="ggplot2",
color_discrete_sequence= px.colors.sequential.Plasma_r)
fig.show()
fig.update_layout(legend=dict(
orientation="h",
yanchor="top",
y=-0.2,
xanchor="center",
x=0.5),
polar=dict(radialaxis=dict(showticklabels=True, ticks='', dtick=1, linewidth=0)
)
)
fig.update_polars(angularaxis_dtick=1,
angularaxis_exponentformat="power")
fig.show()
现在,我想将一些条形图组合在一起,类似于下图(示例python graph gallery):
我不知道如何用 plotly 做到这一点,所以我保留了堆叠条和分组。任何提示或建议将不胜感激。
谢谢!