How can I plot a timeseries with timestamps on the x-axis and "data" that contains only NAN on the y-axis using matplotlib?
The goal is to get an empty plot with timestamps on the x-axis and an empty y-axis. Why do I want to have an empty plot? Well, I am creating plots in a loop for every day of the year and it can happen that the timeseries has data gaps (no, interpolation of data gaps makes no sence).
TIMESTAMP
2019-10-21 12:00:00 NaN
2019-10-21 12:01:00 NaN
2019-10-21 12:02:00 NaN
2019-10-21 12:03:00 NaN
2019-10-21 12:04:00 NaN
..
2019-10-22 11:55:00 NaN
2019-10-22 11:56:00 NaN
2019-10-22 11:57:00 NaN
2019-10-22 11:58:00 NaN
2019-10-22 11:59:00 NaN
Freq: T, Name: df_plot.prec, Length: 1440, dtype: float64
DatetimeIndex(['2019-10-21 12:00:00', '2019-10-21 12:01:00',
'2019-10-21 12:02:00', '2019-10-21 12:03:00',
'2019-10-21 12:04:00', '2019-10-21 12:05:00',
'2019-10-21 12:06:00', '2019-10-21 12:07:00',
'2019-10-21 12:08:00', '2019-10-21 12:09:00',
...
'2019-10-22 11:50:00', '2019-10-22 11:51:00',
'2019-10-22 11:52:00', '2019-10-22 11:53:00',
'2019-10-22 11:54:00', '2019-10-22 11:55:00',
'2019-10-22 11:56:00', '2019-10-22 11:57:00',
'2019-10-22 11:58:00', '2019-10-22 11:59:00'],
dtype='datetime64[ns]', name='TIMESTAMP', length=1440, freq='T')
plt.plot(df_plot.index, df_plot.prec)
results in:
ValueError: view limit minimum -0.001 is less than 1 and is an invalid Matplotlib date value. This often happens if you pass a non-datetime value to an axis that has datetime units
timeseries is of type datetime64