matplotlib.plot 记录

#!/usr/bin/env python
#coding=utf8

import numpy as np
import matplotlib.pyplot as plt

fig=plt.figure()
ax=fig.add_subplot(1,1,1)


font1 = {'family' : 'Times New Roman',
'weight' : 'normal',
'size'   : 22,
}

x=[1,2,3,4]
y=[2,3,4,5]l
ax.plot(x,y,label='haha1')
ax.plot(x,y,label='haha2')
ax.legend(loc=9)
ax.yaxis.set_ticks_position('left')l
plt.tick_params(labelsize=15)
plt.xlabel('x',font1l)
#plt.show()
plt.savefig('./1.png',dpi=90,bbox_inches='tight') 

猜你喜欢

转载自blog.csdn.net/haha074/article/details/82662304