>>>饼图
%matplotlib inline
import matplotlib.pyplot as plt
x=[10,20,30,40]
y=['apple','peach','pear','pineapple']
plt.figure(num=3,figsize=(4,3))
#pie(x, explode=None, labels=None, colors=None, autopct=None, pctdistance=0.6, shadow=False, labeldistance=1.1, startangle=0, radius=1,
#counterclock=True, wedgeprops=None, textprops=None, center=(0, 0), frame=False, rotatelabels=False, *, normalize=None, data=None)
#参数explode 类型为数组,用于表示某一部分数据远离圆心多少距离 其他参数用法可参考官方help
plt.pie(x,labels=y,autopct='%1.2f%%',explode=[0,0,0.1,0],shadow=True)
plt.show()
#help(plt.pie)
>>>柱状图
import matplotlib.pyplot as plt
import numpy as np
plt.figu