Search code examples
pythonmatplotlibpie-chart

How to plot a pie chart with the first wedge on top, in Python? [matplotlib]


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.


Solution

  • 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.

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

    PyPlot documentation on this