Hi! I'm working with data related to the Earth's length of day and El Niño/La Niña events. I would like to add horisontal bars at the top or bottom of the time series plot to represent the occurence and duration of El Niño/La Niña events in a similar way to the pictures. I have imported monthly data for El Niño/La Niña occurences and transformed the index to pandas DateTime-format, but I can't figure out how to create this sort of plot. All I've managed to accomplish is
for elnino_date, enso_value in df_elnino_melted.iterrows():
color = 'red' if enso_value['ENSO'] > 0 else 'blue'
plt.axvline(x=elnino_date, color=color, linestyle='--')
but this gives me a bunch of "bars" going across the whole plot vertically, which makes it very messy. Could someone perhaps help me out, either with getting a plot similar to the pictures or to visualize the El Niño/La Niña events in some other easily interpretable and clean way?