统计图练习2

'''
import matplotlib.pyplot as plt
plt.plot([3,1,4,5,2],[5,9,7,5,8])
plt.ylabel('Grade')
plt.savefig('../R&Q_pic/test0',dpi=600)
plt.show
'''
'''

import matplotlib.pyplot as plt
plt.plot([0,2,4,6,8],[3,1,4,5,2])
plt.xlabel('Course')
plt.ylabel('Grade')
plt.axis([-10,10,-6,6])
plt.savefig('../R&Q_pic/test1',dpi=600)
plt.show()
'''
'''

import numpy as np
import matplotlib.pyplot as plt
a=np.arange(10)
plt.plot(a,100/a,'ro-',label='a')
plt.plot(a,50/a,'gx--',label='b')
plt.plot(a,-50/a,'y*',label='c')
plt.plot(a,-100/a,'bs-',label='d')
plt.plot(a,a*2.5/100/a,'mH--',label='e')
plt.savefig('../R&Q_pic/test2',dpi=600)
plt.legend()
plt.show()
'''
'''

import numpy as np
import matplotlib.pyplot as plt

def f(t):
    return np.exp(-t)*np.cos(2*np.pi*t)

a=np.arange(0,5,0.02)
plt.subplot(322)
plt.plot(a,f(a))

plt.subplot(323)
plt.plot(a,np.cos(2*np.pi*a),'-.',color='r')

plt.subplot(324)
plt.plot(a,np.sin(2*np.pi*a),'--',color='g')

plt.subplot(325)
plt.plot(a,np.tan(2*np.pi*a),':',color='m')

plt.savefig('../R&Q_pic/test3',dpi=600)
plt.show()
'''

'''
import matplotlib.pyplot as plt
from pylab import mpl
mpl.rcParams['font.sans-serif']=['STZhongsong']
labels=['Frogs','Hogs','Dogs','Logs']
sizes=[15,30,45,10]
explode=(0,0.1,0,0)
plt.pie(sizes,explode,labels,autopct='%1.1f%%',shadow=(True),startangle=90)
plt.axis('equal')
plt.savefig('../R&Q_pic/test4',dpi=600)
plt.show()
'''

'''
import matplotlib.pyplot as plt
fig=plt.figure(figsize=(5,4),dpi=72,facecolor='yellow')
plt.subplot(2,2,1)
plt.plot([0,1],[0,1])
plt.subplot(2,2,2)
plt.plot([1,0],[0,1])
plt.subplot(2,2,3)
plt.plot([1,0],[0,1])
plt.subplot(2,2,4)
plt.plot([0,1],[0,1])
plt.savefig('../R&Q_pic/test5',dpi=600)
plt.show()
'''

你可能感兴趣的:(matplotlib,python,开发语言)