[英]How can I set the colors on a plotly sunburst chart using the graph_objects submodule?
[英]Can i show different chart types eg radar, sunburst, doughnut in one graph object using plotly subplots
我已尝试使用以下代码将雷达图和旭日图显示为一张图中的两列 object
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 在一个图形 object 中创建这种类型的多种图表类型。
由于子图可以放置在许多行和列中,因此您必须在规范中提供 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中找到更多用法和示例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.