How To Plot Different Parts Of Same Pandas Series Column With Different Colors?
Let's say I have a Series like this: testdf = pd.Series([3, 4, 2, 5, 1, 6, 10]) When plotting, this is the result: testdf.plot() I want to plot, say, the line up to the first 4
Solution 1:
IIUC
import matplotlib.pyplotas plt
fig, ax = plt.subplots(1, 1)
testdf.plot(ax=ax,color='b')
testdf.iloc[3:].plot(ax=ax,color='r')
Post a Comment for "How To Plot Different Parts Of Same Pandas Series Column With Different Colors?"