Guided Notes

Plotting

Line, bar, scatter, histogram, and box plots straight from pandas, and choosing the right chart.

Plotting with pandas

Slide 1 / 5

pandas can draw charts directly with the plot() method, using the Matplotlib library behind the scenes:

import matplotlib.pyplot as plt df.plot() plt.show()

In Jupyter notebooks the chart appears automatically; in a script, plt.show() opens it, and plt.savefig('chart.png') saves it to a file.

The default plot() draws a line for every numeric column against the index.

← Correlations