Line and Bar Plots
Explore the line and bar plots of pandas.
We'll cover the following...
Line Plots
The DataFrame has a plot
attribute that we can use to plot. Line plots are easy to create. Remember that pandas will plot the index in the x-axis, and each column will be its own line. Below is a default plot. It’s a little hard to process, but along the x-axis are the presidents (from the first to the last), and each line represents what happens to the score from president to president:
Press + to interact
pres.plot().legend(bbox_to_anchor=(1,1))
Let’s make another line plot that is more involved. Each line will ...