I'm wondering if there's a straightforward way to have matplotlib use the same color cycle for all axes in a subplot, rather than 'restarting' it when I plot to a new axis.
MWE:
import matplotlib
import numpy as np
matplotlib.rcParams['axes.prop_cycle'] = matplotlib.cycler(
color=['red', 'blue', 'black']
)
X = np.linspace(0, 100, 100)
fig, (ax1, ax2) = matplotlib.pyplot.subplots(nrows=2)
ax1.plot(X, 1.5*X) # plots red line
ax1.plot(X, 0.9*X) # plots blue line
ax2.plot(X, X) # plots red line again, rather than black line
