Note

Go to the endto download the full example code.

pie(x)#

Plot a pie chart.

Seepie.

pie
importmatplotlib.pyplotaspltimportnumpyasnpplt.style.use('_mpl-gallery-nogrid')# make datax=[1,2,3,4]colors=plt.get_cmap('Blues')(np.linspace(0.2,0.7,len(x)))# plotfig,ax=plt.subplots()ax.pie(x,colors=colors,radius=3,center=(4,4),wedgeprops={"linewidth":1,"edgecolor":"white"},frame=True)ax.set(xlim=(0,8),xticks=np.arange(1,8),ylim=(0,8),yticks=np.arange(1,8))plt.show()

Gallery generated by Sphinx-Gallery