DataFrame.plot() (Matplotlib + Pandas)
df.plot() is pandas' built-in plotting method that draws charts directly from a DataFrame or Series using Matplotlib underneath. It is the fastest way to visualize tabular data without writing Matplotlib calls by hand.
Matplotlib
Pandas wraps Matplotlib so you can plot straight from your data: df.plot() makes a line chart of every numeric column against the index, and the kind argument switches the type — 'bar', 'barh', 'hist', 'box', 'scatter', 'area', 'pie'. The index becomes the x-axis automatically.
Because it returns the Matplotlib Axes it drew on, you can keep customizing with the full Matplotlib API: ax = df.plot(); ax.set_title(...). This blends pandas' convenience with Matplotlib's control, and you can also pass an existing ax= to draw into a specific subplot.
It is ideal for quick exploration during analysis. For highly customized, publication-grade figures you may still drop down to raw Matplotlib, but df.plot() covers the great majority of everyday charts in a single line.
Syntax
df.plot(kind='line', x=None, y=None, ax=None)Examples
Python — plot() returns the Matplotlib Axes it drew on.
import matplotlib
matplotlib.use("Agg")
import pandas as pd
df = pd.DataFrame({"a": [1, 3, 2]})
ax = df.plot(kind="bar")
print(type(ax).__name__)Output:
Axes