Следующее будет работать с текущими версиями matplotlib.
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
t = np.arange("2019-03-11 00:00", "2019-03-13 08:00", dtype=np.datetime64)
x = np.cumsum(np.random.randn(len(t)))
fig, ax = plt.subplots()
ax.plot(t,x)
ax.xaxis.set_major_locator(mdates.HourLocator(12))
ax.xaxis.set_major_formatter(mdates.DateFormatter("%Y-%b-%d"))
ax.xaxis.set_minor_locator(mdates.HourLocator(np.arange(0,24,2)))
ax.xaxis.set_minor_formatter(mdates.DateFormatter("%H"))
ax.tick_params(which="major", axis="x", pad=14, size=2)
ax.tick_params(which="minor", axis="x", labelsize=8)
plt.show()
