如何在Python中绘制第一个楔形在顶部的饼形图? [matplotlib]

问题描述:

如何使用Matplotlib绘制饼图,并从中午开始(即在饼图的顶部)使用第一个楔形来绘制饼图? pyplot.pie()的默认设置是将第一条边放置在三点钟位置,并且能够自定义它会很棒.

How can a pie chart be drawn with Matplotlib with a first wedge that starts at noon (i.e. on the top of the pie)? The default is for pyplot.pie() to place the first edge at three o'clock, and it would be great to be able to customize this.

正因为这是在我的Google搜索中出现的,所以我要补充一点,与此同时,matplotlib将此内容作为pie函数.

Just because this came up in a Google search for me, I'll add that in the meantime, matplotlib has included just this as an additional argument to the pie function.

现在,人们可以调用plt.pie(data, start_angle=90)以使第一个楔形块在中午开始.

Now, one can call plt.pie(data, start_angle=90) to have the first wedge start at noon.

关于此的PyPlot文档