I have attempted to plot a line on my dataset at hr=2, however it changes my x axis scale by about 35 years for some reason. The dataset has 420 datapoints across 6 hours, hence the number in the middle two lines.
fig= plt.figure(figsize=(9,2.7))
iplt.plot(pressure_no1, color='black')
plt.plot(np.linspace(-2, 4, 20), pressure_no1.data)
plt.axvline(0)
plt.xlabel('Time / hour of day')
plt.ylabel('Atmospheric pressure / kPa')
iplt.show()
This code gives me this graph: skewed scale graph the far left blue line is the inserted function line, and far right is the actual data
And this is how the scale should actually be: original graph
Please help, i have no idea how to fix this. Thanks in advance :)