If you need to call plot multiply times, you can also use the "label" argument:
ax = df1.plot(label='df1', y='y_var')
ax = df2.plot(label='df2', y='y_var')
While this is not the case in the OP question, this can be helpful if the DataFrame
is in long format and you use groupby
before plotting.