我试图将matplotlib中的雷达图与饼图相结合,这样我就有了如下示例:
如你所见,在图表的内部有一个雷达图,你可以在其中输入一些值,而在外部,你有不同的类别和子类别。我试着把matplotlib雷达图和一个饼图相结合,我把分类放在那里。但这失败了。有没有人知道如何在雷达图中添加一些类别,以及雷达图不同部分的子类别?在
谢谢。在
-------------------------编辑--------------------
按照建议,我试着把雷达图和饼图结合起来,但我不明白为什么它看起来不像预期的那样。在
plot example result with radar chart and a pie chart
import numpy as np
import matplotlib.pyplot as plt
fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(8, 8), subplot_kw=dict(polar=True))
sizes = [32, 20, 15, 10, 10, 8, 5]
labels = 'apple', 'banana', 'cherry', 'durian', 'elderberries', 'figs', 'grapes'
d = ax.pie(sizes, labels=labels, radius=1, autopct='%1.1f%%', startangle=90, labeldistance=1.05)
ax.set(aspect="equal")
plt.show()
一种选择是在极坐标图的位置创建饼图。具体如下:
相关问题 更多 >
编程相关推荐