maxframe.dataframe.Series.plot#

Series.plot()#

Make plots of Series or DataFrame.

Uses the backend specified by the option plotting.backend. By default, matplotlib is used.

Parameters:

data (Series or DataFrame) – The object for which the method is called.

x#

Only used if data is a DataFrame.

Type:

label or position, default None

maxframe.dataframe.y#

Allows plotting of one column versus another. Only used if data is a DataFrame.

Type:

label, position or list of label, positions, default None

maxframe.dataframe.kind#

The kind of plot to produce:

  • ‘line’ : line plot (default)

  • ‘bar’ : vertical bar plot

  • ‘barh’ : horizontal bar plot

  • ‘hist’ : histogram

  • ‘box’ : boxplot

  • ‘kde’ : Kernel Density Estimation plot

  • ‘density’ : same as ‘kde’

  • ‘area’ : area plot

  • ‘pie’ : pie plot

  • ‘scatter’ : scatter plot (DataFrame only)

  • ‘hexbin’ : hexbin plot (DataFrame only)

Type:

str

maxframe.dataframe.ax#

An axes of the current figure.

Type:

matplotlib axes object, default None

maxframe.dataframe.subplots#

Whether to group columns into subplots:

  • False : No subplots will be used

  • True : Make separate subplots for each column.

  • sequence of iterables of column labels: Create a subplot for each group of columns. For example [(‘a’, ‘c’), (‘b’, ‘d’)] will create 2 subplots: one with columns ‘a’ and ‘c’, and one with columns ‘b’ and ‘d’. Remaining columns that aren’t specified will be plotted in additional subplots (one per column).

Type:

bool or sequence of iterables, default False

maxframe.dataframe.sharex#

In case subplots=True, share x axis and set some x axis labels to invisible; defaults to True if ax is None otherwise False if an ax is passed in; Be aware, that passing in both an ax and sharex=True will alter all x axis labels for all axis in a figure.

Type:

bool, default True if ax is None else False

maxframe.dataframe.sharey#

In case subplots=True, share y axis and set some y axis labels to invisible.

Type:

bool, default False

maxframe.dataframe.layout#

(rows, columns) for the layout of subplots.

Type:

tuple, optional

maxframe.dataframe.figsize#

Size of a figure object.

Type:

a tuple (width, height) in inches

maxframe.dataframe.use_index#

Use index as ticks for x axis.

Type:

bool, default True

maxframe.dataframe.title#

Title to use for the plot. If a string is passed, print the string at the top of the figure. If a list is passed and subplots is True, print each item in the list above the corresponding subplot.

Type:

str or list

maxframe.dataframe.grid#

Axis grid lines.

Type:

bool, default None (matlab style default)

maxframe.dataframe.legend#

Place legend on axis subplots.

Type:

bool or {‘reverse’}

maxframe.dataframe.style#

The matplotlib line style per column.

Type:

list or dict

maxframe.dataframe.logx#

Use log scaling or symlog scaling on x axis.

Type:

bool or ‘sym’, default False

maxframe.dataframe.logy#

Use log scaling or symlog scaling on y axis.

Type:

bool or ‘sym’ default False

maxframe.dataframe.loglog#

Use log scaling or symlog scaling on both x and y axes.

Type:

bool or ‘sym’, default False

maxframe.dataframe.xticks#

Values to use for the xticks.

Type:

sequence

maxframe.dataframe.yticks#

Values to use for the yticks.

Type:

sequence

maxframe.dataframe.xlim#

Set the x limits of the current axes.

Type:

2-tuple/list

maxframe.dataframe.ylim#

Set the y limits of the current axes.

Type:

2-tuple/list

maxframe.dataframe.xlabel#

Name to use for the xlabel on x-axis. Default uses index name as xlabel, or the x-column name for planar plots.

Changed in version 2.0.0: Now applicable to histograms.

Type:

label, optional

maxframe.dataframe.ylabel#

Name to use for the ylabel on y-axis. Default will show no ylabel, or the y-column name for planar plots.

Changed in version 2.0.0: Now applicable to histograms.

Type:

label, optional

maxframe.dataframe.rot#

Rotation for ticks (xticks for vertical, yticks for horizontal plots).

Type:

float, default None

maxframe.dataframe.fontsize#

Font size for xticks and yticks.

Type:

float, default None

maxframe.dataframe.colormap#

Colormap to select colors from. If string, load colormap with that name from matplotlib.

Type:

str or matplotlib colormap object, default None

maxframe.dataframe.colorbar#

If True, plot colorbar (only relevant for ‘scatter’ and ‘hexbin’ plots).

Type:

bool, optional

maxframe.dataframe.position#

Specify relative alignments for bar plot layout. From 0 (left/bottom-end) to 1 (right/top-end). Default is 0.5 (center).

Type:

float

maxframe.dataframe.table#

If True, draw a table using the data in the DataFrame and the data will be transposed to meet matplotlib’s default layout. If a Series or DataFrame is passed, use passed data to draw a table.

Type:

bool, Series or DataFrame, default False

maxframe.dataframe.yerr#

See Plotting with Error Bars for detail.

Type:

DataFrame, Series, array-like, dict and str

maxframe.dataframe.xerr#

Equivalent to yerr.

Type:

DataFrame, Series, array-like, dict and str

maxframe.dataframe.stacked#

If True, create stacked plot.

Type:

bool, default False in line and bar plots, and True in area plot

maxframe.dataframe.secondary_y#

Whether to plot on the secondary y-axis if a list/tuple, which columns to plot on secondary y-axis.

Type:

bool or sequence, default False

maxframe.dataframe.mark_right#

When using a secondary_y axis, automatically mark the column labels with “(right)” in the legend.

Type:

bool, default True

maxframe.dataframe.include_bool#

If True, boolean values can be plotted.

Type:

bool, default is False

maxframe.dataframe.backend#

Backend to use instead of the backend specified in the option plotting.backend. For instance, ‘matplotlib’. Alternatively, to specify the plotting.backend for the whole session, set pd.options.plotting.backend.

Type:

str, default None

\*\*kwargs

Options to pass to matplotlib plotting method.

Returns:

If the backend is not the default matplotlib one, the return value will be the object returned by the backend.

Return type:

matplotlib.axes.Axes or numpy.ndarray of them

See also

matplotlib.pyplot.plot

Plot y versus x as lines and/or markers.

DataFrame.hist

Make a histogram.

DataFrame.boxplot

Make a box plot.

DataFrame.plot.scatter

Make a scatter plot with varying marker point size and color.

DataFrame.plot.hexbin

Make a hexagonal binning plot of two variables.

DataFrame.plot.kde

Make Kernel Density Estimate plot using Gaussian kernels.

DataFrame.plot.area

Make a stacked area plot.

DataFrame.plot.bar

Make a bar plot.

DataFrame.plot.barh

Make a horizontal bar plot.

Notes

  • See matplotlib documentation online for more on this subject

  • If kind = ‘bar’ or ‘barh’, you can specify relative alignments for bar plot layout by position keyword. From 0 (left/bottom-end) to 1 (right/top-end). Default is 0.5 (center)

Examples

For Series:

(Source code)

For DataFrame:

(Source code)

For SeriesGroupBy:

(Source code)

For DataFrameGroupBy:

(Source code)