I use matplotlib.pyplot to plot a DataFrame with time index and 2 columns I want to compare
I got misleading single line plot when plotting a 2 column comparison of time data with divergent time frequency, ex. 1st column has data for every 30 min, the other one for every 1 hour
Example:If I try to plot DataFrame with data for divergent timestamps,I got the attached plot instead of a proper comparison.
The correct plot would consist of 2 lines, each line for one column of data. Ex. for the row: 2024-01-23 10:00:00+01:00 654.008700 541.8 - a point at Y=654.0 and another point at Y=541.8 for the same X coordinate of 2024-01-23 10:00.
After resampling to 1h it works as expected
index DF1 Data DF2 Data
...
2024-01-23 08:00:00+01:00 436.056895 112.8
2024-01-23 08:30:00+01:00 NaN 196.4
2024-01-23 09:00:00+01:00 612.318043 353.3
2024-01-23 09:30:00+01:00 NaN 486.1
2024-01-23 10:00:00+01:00 654.008700 541.8
2024-01-23 10:30:00+01:00 NaN 545.0
2024-01-23 11:00:00+01:00 554.250554 524.2
2024-01-23 11:30:00+01:00 NaN 440.9
2024-01-23 12:00:00+01:00 331.314655 322.4
2024-01-23 12:30:00+01:00 NaN 301.4
2024-01-23 13:00:00+01:00 59.173102 346.3
2024-01-23 13:30:00+01:00 NaN 297.2
2024-01-23 14:00:00+01:00 -3.408000 208.9
2024-01-23 14:30:00+01:00 NaN 137.9...
Is there a way to make it work or another ploting module that enables such comparison?