我可以在极坐标条形图中制作分组条形图吗?

问题描述 投票:0回答:1

我有一个极坐标条形图,图中有堆叠条形图,它也使用我添加的代码给出了下图(示例在这里找到: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 做到这一点,所以我保留了堆叠条和分组。任何提示或建议将不胜感激。

谢谢!

python matplotlib plotly bar-chart polar-coordinates
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.