API reference#

Objects interface#

Plot object#

Plot

An interface for declaratively specifying statistical graphics.

Mark objects#

Dot marks

Dot

A mark suitable for dot plots or less-dense scatterplots.

Dots

A dot mark defined by strokes to better handle overplotting.

Line marks

Line

A mark connecting data points with sorting along the orientation axis.

Lines

A faster but less-flexible mark for drawing many lines.

Path

A mark connecting data points in the order they appear.

Paths

A faster but less-flexible mark for drawing many paths.

Dash

A line mark drawn as an oriented segment for each datapoint.

Range

An oriented line mark drawn between min/max values.

Bar marks

Bar

A bar mark drawn between baseline and data values.

Bars

A faster bar mark with defaults more suitable histograms.

Fill marks

Area

A fill mark drawn from a baseline to data values.

Band

A fill mark representing an interval between values.

Text marks

Text

A textual mark to annotate or represent data values.

Stat objects#

Agg

Aggregate data along the value axis using given method.

Est

Calculate a point estimate and error bar interval.

Count

Count distinct observations within groups.

Hist

Bin observations, count them, and optionally normalize or cumulate.

Perc

Replace observations with percentile values.

PolyFit

Fit a polynomial of the given order and resample data onto predicted curve.

Move objects#

Dodge

Displacement and narrowing of overlapping marks along orientation axis.

Jitter

Random displacement along one or both axes to reduce overplotting.

Norm

Divisive scaling on the value axis after aggregating within groups.

Stack

Displacement of overlapping bar or area marks along the value axis.

Shift

Displacement of all marks with the same magnitude / direction.

Scale objects#

Continuous

A numeric scale supporting norms and functional transforms.

Nominal

A categorical scale without relative importance / magnitude.

Temporal

A scale for date/time data.

Base classes#

Mark

Base class for objects that visually represent data.

Stat

Base class for objects that apply statistical transformations.

Move

Base class for objects that apply simple positional transforms.

Scale

Base class for objects that map data values to visual properties.

Function interface#

Relational plots#

relplot

Figure-level interface for drawing relational plots onto a FacetGrid.

scatterplot

Draw a scatter plot with possibility of several semantic groupings.

lineplot

Draw a line plot with possibility of several semantic groupings.

Distribution plots#

displot

Figure-level interface for drawing distribution plots onto a FacetGrid.

histplot

Plot univariate or bivariate histograms to show distributions of datasets.

kdeplot

Plot univariate or bivariate distributions using kernel density estimation.

ecdfplot

Plot empirical cumulative distribution functions.

rugplot

Plot marginal distributions by drawing ticks along the x and y axes.

distplot

DEPRECATED

Categorical plots#

catplot

Figure-level interface for drawing categorical plots onto a FacetGrid.

stripplot

Draw a categorical scatterplot using jitter to reduce overplotting.

swarmplot

Draw a categorical scatterplot with points adjusted to be non-overlapping.

boxplot

Draw a box plot to show distributions with respect to categories.

violinplot

Draw a combination of boxplot and kernel density estimate.

boxenplot

Draw an enhanced box plot for larger datasets.

pointplot

Show point estimates and errors using dot marks.

barplot

Show point estimates and errors as rectangular bars.

countplot

Show the counts of observations in each categorical bin using bars.

Regression plots#

lmplot

Plot data and regression model fits across a FacetGrid.

regplot

Plot data and a linear regression model fit.

residplot

Plot the residuals of a linear regression.

Matrix plots#

heatmap

Plot rectangular data as a color-encoded matrix.

clustermap

Plot a matrix dataset as a hierarchically-clustered heatmap.

Multi-plot grids#

Facet grids#

FacetGrid

Multi-plot grid for plotting conditional relationships.

Pair grids#

pairplot

Plot pairwise relationships in a dataset.

PairGrid

Subplot grid for plotting pairwise relationships in a dataset.

Joint grids#

jointplot

Draw a plot of two variables with bivariate and univariate graphs.

JointGrid

Grid for drawing a bivariate plot with marginal univariate plots.

Themeing#

set_theme

Set aspects of the visual theme for all matplotlib and seaborn plots.

axes_style

Get the parameters that control the general style of the plots.

set_style

Set the parameters that control the general style of the plots.

plotting_context

Get the parameters that control the scaling of plot elements.

set_context

Set the parameters that control the scaling of plot elements.

set_color_codes

Change how matplotlib color shorthands are interpreted.

reset_defaults

Restore all RC params to default settings.

reset_orig

Restore all RC params to original settings (respects custom rc).

set

Alias for set_theme(), which is the preferred interface.

Color palettes#

set_palette

Set the matplotlib color cycle using a seaborn palette.

color_palette

Return a list of colors or continuous colormap defining a palette.

husl_palette

Return hues with constant lightness and saturation in the HUSL system.

hls_palette

Return hues with constant lightness and saturation in the HLS system.

cubehelix_palette

Make a sequential palette from the cubehelix system.

dark_palette

Make a sequential palette that blends from dark to color.

light_palette

Make a sequential palette that blends from light to color.

diverging_palette

Make a diverging palette between two HUSL colors.

blend_palette

Make a palette that blends between a list of colors.

xkcd_palette

Make a palette with color names from the xkcd color survey.

crayon_palette

Make a palette with color names from Crayola crayons.

mpl_palette

Return a palette or colormap from the matplotlib registry.

Palette widgets#

choose_colorbrewer_palette

Select a palette from the ColorBrewer set.

choose_cubehelix_palette

Launch an interactive widget to create a sequential cubehelix palette.

choose_light_palette

Launch an interactive widget to create a light sequential palette.

choose_dark_palette

Launch an interactive widget to create a dark sequential palette.

choose_diverging_palette

Launch an interactive widget to choose a diverging color palette.

Utility functions#

despine

Remove the top and right spines from plot(s).

move_legend

Recreate a plot's legend at a new location.

saturate

Return a fully saturated color with the same hue.

desaturate

Decrease the saturation channel of a color by some percent.

set_hls_values

Independently manipulate the h, l, or s channels of a color.

load_dataset

Load an example dataset from the online repository (requires internet).

get_dataset_names

Report available example datasets, useful for reporting issues.

get_data_home

Return a path to the cache directory for example datasets.