Example Plot I have a dataframe that includes time series of snow-water and temperature data. I am looking to create a time series plot of snow water, that shows two colors in the snow water line plot, 'blue' if the temperature is < = 273 deg K and 'red' if the temperature is > 273 deg K. I tried to follow the matplotib documentation (https://matplotlib.org/3.1.1/gallery/lines_bars_and_markers/multicolored_line.html) but have not been successful. Would appreciate some insights. Thank you!
My dataframe is as follows: Date (datetime64[ns]); Snow-water (float64) and Temp (float64)
from matplotlib.collections import LineCollection
Date Snowwater Temperature
2014-01-01 01:00:00 5 240
2014-01-01 02:00:00 10 270
2014-01-01 03:00:00 11 273
2014-01-01 04:00:00 15 279
2014-01-01 05:00:00 20 300
2014-01-01 06:00:00 25 310
I am looking for output something like in the example plot linked above but with snow-water values in the y-axis (line color blue or red depending on the temperature) and datetime on the x-axis
