我尝试了下面的代码,将雷达图和太阳暴图显示为一个图形对象中的两列
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'}]是否可以使用plotly在一个图形对象中创建此类型的多个图表类型。
发布于 2020-11-26 19:16:25
由于子图可以放置在许多行和列中,因此必须在等级库中提供2D数组。因此,您必须传递list of lists of dict而不是list of dicts。
fig = make_subplots(rows=1, cols=2,
specs=[ # first row
[
{'type': 'radar'}, # first col
{'type': 'polar'} # second col
]
])您还可以在docs中找到更多用法和示例。
https://stackoverflow.com/questions/65020373
复制相似问题