I want to use the same color cycle when plotting two pandas dataframes whose columns are the same but represent a different experiment. For example,
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
f1 = lambda x: (x/1)**2
f2 = lambda x: (x/2)**2
f3 = lambda x: (x/3)**2
x = np.linspace(0, 1, 100)
exp1 = pd.DataFrame({'f1': f1(x),
'f2': f2(x),
'f3': f3(x)})
exp2 = exp1 * 1.5
fig, ax = plt.subplots()
exp1.plot(ax=ax)
exp2.plot(ax=ax, style='--', legend=False)
Gives a figure that looks like:
The second plot command continues where the color cycle left off after the first one. What is the best way to 'reset' the color cycle between successive plotting commands of pandas DataFrames?