# coding=utf-8
from matplotlib import pyplot as plt
x = range(2,26,2)
y = [15,13,14.5,17,20,25,26,26,24,22,18,15]
fig = plt.figure(figsize=(20,8),dpi=80)#设置图片大小
plt.xticks(range(2,25))#x坐标轴
plt.yticks(range(min(y),max(y)+1))#y坐标轴
plt.plot(x,y)#绘图
plt.savefig('./t1.jpg')#保存
plt.show()#显示
效果图: