How to plot two columns of single DataFrame on Y axis I have two data frames (Action, Comedy). Action contains two columns (year, rating) ratings columns contains average rating with respect to year. The Comedy data frame contains the same two columns with different mean values.
I merged both data frames into a total_year data frame.
The output of total_year:

Now, I would like to plot total_year on a line graph in which the X axis should contain the year column and the Y axis should contain both the action and the comedy columns.
I can plot only 1 column at a time on Y axis using following code:
total_year[-15:].plot(x='year', y='action' ,figsize=(10,5), grid=True)

How can I plot both columns on the Y axis?
I took this photo from google just to let you know guys I want to draw graph in this way:
Feeding your column names into the y values argument as a list works for me like so:
total_year[-15:].plot(x='year', y=['action', 'comedy'], figsize=(10,5), grid=True)

Using something like the answer at this link is better and gives you way more control over the labels and whatnot:
adding lines with plt.plot()