如何在Python中绘制第一个楔形在顶部的饼形图? [matplotlib] [英] How to plot a pie chart with the first wedge on top, in Python? [matplotlib]

查看:124
本文介绍了如何在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文档

这篇关于如何在Python中绘制第一个楔形在顶部的饼形图? [matplotlib]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆