from matplotlib import pyplot as plt
import random
x = range(1,13)
y = [random.randint(20,30) for i in range(12)]
t=[i/2 for i in range(1,25)]
#设置图片大小
plt.figure(figsize=(20,10),dpi=100)
plt.xticks(t)
plt.yticks(range(min(y),max(y)+5))
#绘图
plt.plot(x,y)
plt.show()