#coding=utf-8 """ author=wanggang date:Jan,12,2020 """ import matplotlib.pyplot as plt name_list = ['confidence2', 'confidence4', 'confidence6','confidence8'] num_list = [1033, 2404, 2500, 1367] colors = ['green','pink', 'blue', 'red'] # 圆形 plt.figure(1, figsize=(6, 6)) #决定分割部分,及其与其它部分之间的间距 expl = [0, 0, 0, 0.1] plt.pie(x=num_list, explode=expl, labels=name_list, autopct='%3.1f %%', colors=colors, shadow=True) plt.show()
python画饼图,其他不多说,直接干。
最新推荐文章于 2024-04-09 11:04:36 发布