import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
df1 = pd.DataFrame(np.random.randint(0,15,size=(15, 1)))
df2 = pd.DataFrame(np.random.randint(20,
Just plot only the part of the dataframe which you want in whatever color you like, e.g. df3.iloc[:15,:].plot(color="green")
.
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
df1 = pd.DataFrame(np.random.randint(0,15,size=(15, 1)))
df2 = pd.DataFrame(np.random.randint(20,35,size=(10, 1)))
frames = [df1, df2]
result = pd.DataFrame(pd.concat(frames))
df3 = result.cumsum()
df3 = df3.reset_index(drop=False)
print(df3)
ax = df3.iloc[:15,:].plot(y=0, color="crimson")
df3.iloc[15:,:].plot(y=0, color="C0", ax=ax)
plt.show()