In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces python how to use plt.pie to draw pie chart, the article is very detailed, has a certain reference value, interested friends must read it!
Description
1. Call plt.pie () to draw and calculate the proportion of each item.
The parameter fracs represents the scale.
2. Explode indicates the distance from the whole circle.
For example, the distance from 0.08.
3. Labels represents the class mark.
4. Shadow=True indicates that the figure is shaded.
5. Startangle indicates the starting angle.
The default value is 0.
Example
#-*-coding: utf-8-*-# By:Eastmount CSDNimport matplotlib.pyplot as plt # proportion of each piece The summation is 100mm = [45,30,25] n = mm [0] + mm [1] + mm [2] a = (mm [0] * 1.003100apporium) b = (mm [1] * 1.05100apporium) c = (mm [2] * 1.05100apt) fracs = [a, b, c] print (a, b, c, n) # the distance from the whole explode= (0,0,0.08) labels ='A','B' 'C' # drawing plt.pie (fracs, explode=explode, labels=labels, autopct='%1.1f%%', shadow=True, startangle=90, colors = ("c", "r", "y")) plt.show () expand the display plate counterclockwise Choose different colors in turn. The above is all the contents of the article "how to draw a pie chart with python with plt.pie". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.