bigframes.pandas.api.typing.PlotAccessor#
- class bigframes.pandas.api.typing.PlotAccessor(data)[source]#
Make plots of Series or DataFrame with the matplotlib backend.
Examples: For Series:
>>> import bigframes.pandas as bpd >>> ser = bpd.Series([1, 2, 3, 3]) >>> plot = ser.plot(kind='hist', title="My plot")
For DataFrame:
>>> df = bpd.DataFrame({'length': [1.5, 0.5, 1.2, 0.9, 3], ... 'width': [0.7, 0.2, 0.15, 0.2, 1.1]}, ... index=['pig', 'rabbit', 'duck', 'chicken', 'horse']) >>> plot = df.plot(title="DataFrame Plot")
- Parameters:
data (Series or DataFrame) – The object for which the method is called.
kind (str) –
The kind of plot to produce:
’line’ : line plot (default)
’hist’ : histogram
’area’ : area plot
’scatter’ : scatter plot (DataFrame only)
**kwargs – Options to pass to pandas.DataFrame.plot method. See pandas documentation online for more on these arguments.
- Returns:
An ndarray is returned with one
matplotlib.axes.Axesper column whensubplots=True.- Return type:
matplotlib.axes.Axes or np.ndarray of them
Methods
__init__(data)area([x, y, stacked])Draw a stacked area plot.
bar([x, y])Draw a vertical bar plot.
barh([x, y])Draw a horizontal bar plot.
hist([by, bins])Draw one histogram of the DataFrame’s columns.
line([x, y])Plot Series or DataFrame as lines.
pie([y])Generate a pie plot.
scatter([x, y, s, c])Create a scatter plot with varying marker point size and color.