I want a plot with the xticklabels as datetime-like objects and the colors to be True/False (1,0) depending on whether that time has been sampled.
The data I am working with looks like this:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
all_days = pd.date_range("2001-01-01", "2020-12-31", freq="D")
times = all_days[::10]
arr = np.isin(all_days, times).reshape(1, -1)
The plotting code I have is here:
Producing a plot without the colouring (but the correct labels)
plt.pcolormesh(all_days, np.ones(1), arr)
Or without the labels but with the colouring
plt.pcolormesh(arr)
Ultimately, I want a combination of these two plots, the xticklabels of the former and the colouring of the latter.


