pandas.DataFrame.plot
pandas 3.1.1 · DataFrame · method
Create a chart using the chosen plotting backend and kind.
Call syntax
DataFrame.plot(data)Inspect the call
Run this code to inspect the callable and its parameters. Its data, backend, or environment is needed to execute the operation itself.
Parameters
| Parameter | Requirement | Accepted values and behavior |
|---|---|---|
data |
Required Positional or keyword |
Series or DataFrame Provide the input data read, transformed, or stored by this call. |
Returns
matplotlib.axes.Axes or numpy.ndarray of them
Example for a local Python session
import pandas as pd
import matplotlib
frame = pd.DataFrame({"units": [2., 5., 7.], "price": [4., 3., 2.]})
print(frame.plot(x="units", y="price"))