Plotting with Pandas

It might surprise you to be reading about pandas in a week about plotting, but when it comes to making quick exploratory plots, pandas actually has a lot to offer.

Indeed, pandas not only comes with a built-in plotter for directly plotting pandas data in matplotlib (e.g., df.plot()), but with the kind argument (e.g., df.plot(kind="...")) you can also get pandas to quickly generate:

  • bar plots ("bar" or "hbar")

  • histograms ("hist")

  • boxplots ("box")

  • density plots ("density" or "kde")

  • area plots ("area")

  • scatter plots ("scatter")

  • hexagonal bin plots ("hexbin")

  • pie plots ("pie")

In all cases, the use of these methods will return a matplotlib plot you can then modify further using standard matplotlib methods if you want!

To learn more or to see examples, check out the panda’s documentation on charting here.