Python 我可以使用绘图子图在一个图形对象中显示不同的图表类型,例如雷达、太阳暴流、甜甜圈吗

Python 我可以使用绘图子图在一个图形对象中显示不同的图表类型,例如雷达、太阳暴流、甜甜圈吗,python,charts,plotly,Python,Charts,Plotly,我尝试了下面的代码,在一个图形对象中将雷达图和日暴图显示为两列 But I get the below error... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/em/.local/lib/python3.8/site-packages/plotly/subplots.py", line 436, i

我尝试了下面的代码,在一个图形对象中将雷达图和日暴图显示为两列

But I get the below error...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/em/.local/lib/python3.8/site-packages/plotly/subplots.py", line 436, in make_subplots
    raise ValueError(
ValueError: 
The 'specs' argument to make_subplots must be a 2D list of dictionaries with dimensions (1 x 2).
    Received value of type <class 'list'>: [{'type': 'radar'}, {'type': 'polar'}]
但我得到以下错误。。。
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“/home/em/.local/lib/python3.8/site packages/plotly/subplot.py”,第436行,在make_子地块中
升值误差(
值错误:
用于生成_子图的“specs”参数必须是具有维度(1 x 2)的字典的二维列表。
接收的类型值:[{'type':'radar'},{'type':'polar'}]

是否可以使用plotly在一个图形对象中创建这种类型的多个图表类型。

由于子地块可以放置在许多行和列中,您必须提供规范中的2D数组。因此,您必须传递
dict列表,而不是
dict列表

fig = make_subplots(rows=1, cols=2,
                    specs=[  # first row
                        [
                            {'type': 'radar'},  # first col
                            {'type': 'polar'}  # second col
                        ]
                    ])
您还可以在中找到更多用法和示例