python饼形图_Python | 饼形图
python餅形圖
A pie plot or a pie chart is a circular statistical graphic technique, in which a circle is divided into slices with respect to numerical proportion. In a pie chart, the arc length, central angle, and area of each slice, is proportional to the quantity it represents. The sum of the total is always equal to 100 percent in the basic pie chart.
餅圖或餅圖是一種圓形統計圖形技術,其中將一個圓形按數值比例分為多個切片。 在餅圖中,每個切片的弧長,圓心角和面積與其表示的量成比例。 在基本餅圖中,總數的總和始終等于100%。
The name pie in the pie plot is derived for its resemblance to a pie that has been sliced. Pie charts are very widely used in the different types of projects and business world. Matplotlib has a defined function in matplotlib.pyplot.pie() for plotting a pie chart.
餅圖中的派餅名稱是由于與切成薄片的餅相似而派生的。 餅圖在不同類型的項目和商業環境中得到了廣泛的使用。 Matplotlib在matplotlib.pyplot.pie()中具有定義的函數,用于繪制餅圖。
matplotlib.pyplot.pie(sizes, labels=labels, autopct='%1.1f%%') #Square textbox style餅圖的Python代碼 (Python code for pie chart)
# Data Visualization using Python # Pie Chartimport matplotlib.pyplot as plt# Pie chart, where the slices will be ordered # and plotted counter-clockwise: labels = 'A', 'B', 'C', 'D', 'E', 'F' sizes = [15, 20, 10, 17, 1, 37]plt.figure() plt.pie(sizes, labels=labels, autopct='%1.1f%%') # Equal aspect ratio ensures that pie is drawn # as a circle. plt.axis('equal') plt.show()Output:
輸出:
Output is as figure翻譯自: https://www.includehelp.com/python/pie-chart.aspx
python餅形圖
總結
以上是生活随笔為你收集整理的python饼形图_Python | 饼形图的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 恒生估值系统_恒生指数和恒生国企指数投资
- 下一篇: c#中将整数转化为字符串_在C#中将字符