我无法将图形保存到jpeg(或任何其他)文件(空白)
x=list(df2['DAYTIME'])
z=list(df2['av100002 - temp Wywiew'])
x3= x[::75]
fig1 = plt.figure()
axes1 = fig1.add_axes([0,30,3.5,1.4])
axes1.set_title('Nawiew')
axes1.plot(x,z, lw=3)
axes1.set_xticks(x3)
plt.xticks(x3, rotation=60)
fig1.savefig('xx.png', dpi=200)
您的轴位置错误,使轴偏离图形。
尝试使用axes1 = fig1.add_subplot()
进行快速修复,其中creates an axes centered in the figure space。
如果要使用add_axes()
手动放置轴,则the coordinates are given in figure fractions。坐标为[left,bottom,width,height],其中0表示图形的左/下边缘,1表示图形的右/上边缘。
默认情况下,fig.add_subplot()
等同于fig.add_axes([0.125, 0.11, 0.9, 0.88])