You are ambushed by a false assumption about the nature of gca() . I was also surprised, so I decided to add an answer (otherwise we mostly talk about the typo problem). I also note that the problem has nothing to do with pandas.
Here is a minimal example reproducing your problem without pandas:
import matplotlib.pyplot as plt f, (ax1, ax2) = plt.subplots(ncols = 2) p1, = ax1.plot([1,2,3], label="test1") p2, = ax1.plot([3,2,1], label="test2") l1 = ax1.legend([p1], ["Label 1"], loc=1) l2 = ax1.legend([p2], ["Label 2"], loc=4)
So what's the problem? Take a look at the error message:
ValueError: Cannot reset axes. Perhaps you are trying to reuse the artist in several axes, which is not supported
(my emphasis). Take a look:
>>> ax1 <matplotlib.axes._subplots.AxesSubplot at 0x7fd83abf7e10> >>> ax2 <matplotlib.axes._subplots.AxesSubplot at 0x7fd83a992850> >>> plt.gca() <matplotlib.axes._subplots.AxesSubplot at 0x7fd83a992850>
The problem is that although you are working with ax1 , the "graphic current axes", also called gca() point to ax2 , Axes created last.
The solution is now simple: be explicit with a redraw call (remember that explicit is better than implicit):
import matplotlib.pyplot as plt f, (ax1, ax2) = plt.subplots(ncols = 2) p1, = ax1.plot([1,2,3], label="test1") p2, = ax1.plot([3,2,1], label="test2") l1 = ax1.legend([p1], ["Label 1"], loc=1) l2 = ax1.legend([p2], ["Label 2"], loc=4)
And it's live!

If you really want to use the df.plot ( df.plot function) instead of managing the df.plot you df.plot , you will have to do a bit more work. Unfortunately, df.plot returns the Axes object it builds (and not the list of line features included in the graph), so we need to look at the Axes children to find the graphs. The above example using data frames:
import pandas as pd import matplotlib import matplotlib.pyplot as plt