【发布时间】:2016-03-07 09:24:26
【问题描述】:
我想做一个饼图,但是python似乎切断了左右两边的标签。有没有办法强制显示所有标签? 这是我制作情节的方法
import matplotlib.pyplot as plt
plt.clf()
# get all the groups from the database
tests ...
plt.axes([0.1, 0.1, 0.6, 0.6])
# The slices will be ordered and plotted counter-clockwise.
fracs = [test for test in tests]
labels = ...
explode = [ 0 everywhere ]
plt.pie(fracs, explode=explode, labels=labels, autopct='%1.1f%%', shadow=True, startangle=90)
# Set aspect ratio to be equal so that pie is drawn as a circle.
plt.axis('equal')
plt.title('title', y=1.15)
plt.savefig(store path "_pie.png")
情节是这样的
有谁知道如何避免标签被截断? 谢谢 卡尔
【问题讨论】:
标签: python matplotlib plot pie-chart