My Brain Cells

Easiest (and best) learning materials for anyone with a curiosity for machine learning and artificial intelligence, Deep learning, Programming, and other fun life hacks.

Seaborn – (all functions)

 

seaborn: statistical data visualization

#pip install seaborn #conda install seaborn
import seaborn as sns

Functions:

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: Flexibly plot a univariate distribution of observations.

Categorical plots

catplot

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

stripplot

Draw a scatterplot where one variable is categorical.

swarmplot

Draw a categorical scatterplot with non-overlapping points.

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 confidence intervals using scatter plot glyphs.

barplot

Show point estimates and confidence intervals 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.

FacetGrid.map

Apply a plotting function to each facet’s subset of the data.

FacetGrid.map_dataframe

Like .map but passes args as strings and inserts data in kwargs.

Pair grids

pairplot

Plot pairwise relationships in a dataset.

PairGrid

Subplot grid for plotting pairwise relationships in a dataset.

PairGrid.map

Plot with the same function in every subplot.

PairGrid.map_diag

Plot with a univariate function on each diagonal subplot.

PairGrid.map_offdiag

Plot with a bivariate function on the off-diagonal subplots.

PairGrid.map_lower

Plot with a bivariate function on the lower diagonal subplots.

PairGrid.map_upper

Plot with a bivariate function on the upper diagonal subplots.

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.

JointGrid.plot

Draw the plot by passing functions for joint and marginal axes.

JointGrid.plot_joint

Draw a bivariate plot on the joint axes of the grid.

JointGrid.plot_marginals

Draw univariate plots on each marginal axes.

Themeing

set_theme

Set multiple theme parameters in one step.

axes_style

Return a parameter dict for the aesthetic style of the plots.

set_style

Set the aesthetic style of the plots.

plotting_context

Return a parameter dict to scale elements of the figure.

set_context

Set the plotting context parameters.

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

Get a set of evenly spaced colors in HUSL hue space.

hls_palette

Get a set of evenly spaced colors in HLS hue space.

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 discrete colors from a matplotlib palette.

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

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.

despine

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

desaturate

Decrease the saturation channel of a color by some percent.

saturate

Return a fully saturated color with the same hue.

set_hls_values

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

Anthony

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top