This is a major release with several substantial and long-desired new features. There are also updates/modifications to the themes and color palettes that give better consistency with matplotlib 2.0 and some notable API changes.
Three completely new plotting functions have been added: relplot()
, scatterplot()
, and lineplot()
. The first is a figure-level interface to the latter two that combines them with a FacetGrid
. The functions bring the high-level, dataset-oriented API of the seaborn categorical plotting functions to more general plots (scatter plots and line plots).
These functions can visualize a relationship between two numeric variables while mapping up to three additional variables by modifying hue
, size
, and/or style
semantics. The common high-level API is implemented differently in the two functions. For example, the size semantic in scatterplot()
scales the area of scatter plot points, but in lineplot()
it scales width of the line plot lines. The API is dataset-oriented, meaning that in both cases you pass the variable in your dataset rather than directly specifying the matplotlib parameters to use for point area or line width.
Another way the relational functions differ from existing seaborn functionality is that they have better support for using numeric variables for hue
and size
semantics. This functionality may be propagated to other functions that can add a hue
semantic in future versions; it has not been in this release.
The lineplot()
function also has support for statistical estimation and is replacing the older tsplot
function, which still exists but is marked for removal in a future release. lineplot()
is better aligned with the API of the rest of the library and more flexible in showing relationships across additional variables by modifying the size and style semantics independently. It also has substantially improved support for date and time data, a major pain factor in tsplot
. The cost is that some of the more esoteric options in tsplot
for representing uncertainty (e.g. a colormapped KDE of the bootstrap distribution) have not been implemented in the new function.
There is quite a bit of new documentation that explains these new functions in more detail, including detailed examples of the various options in the API reference and a more verbose tutorial.
These functions should be considered in a “stable beta” state. They have been thoroughly tested, but some unknown corner cases may remain to be found. The main features are in place, but not all planned functionality has been implemented. There are planned improvements to some elements, particularly the default legend, that are a little rough around the edges in this release. Finally, some of the default behavior (e.g. the default range of point/line sizes) may change somewhat in future releases.
Several changes have been made to the seaborn style themes, context scaling, and color palettes. In general the aim of these changes was to make the seaborn styles more consistent with the style updates in matplotlib 2.0 and to leverage some of the new style parameters for better implementation of some aspects of the seaborn styles. Here is a list of the changes:
axes_style()
/plotting_context()
parameters to take advantage of improvements in the matplotlib 2.0 update. The biggest change involves using several new parameterss in the “style” spec while moving parameters that used to implement the corresponding aesthetics to the “context” spec. For example, axes spines and ticks are now off instead of having their width/length zeroed out for the darkgrid style. That means the width/length of these elements can now be scaled in different contexts. The effect is a more cohesive appearance of the plots, especially in larger contexts. These changes include only minimal support for the 1.x matplotlib series. Users who are stuck on matplotlib 1.5 but wish to use seaborn styling may want to use the seaborn parameters that can be accessed through the matplotlib stylesheet interface.color_palette()
(or set_palette()
) with a named qualitative palettes (i.e. one of the seaborn palettes, the colorbrewer qualitative palettes, or the matplotlib matplotlib tableau-derived palettes) and no specified number of colors will return all of the colors in the palette. This means that for some palettes, the returned list will have a different length than it did in previous versions.color_palette()
to accept a parameterized specification of a cubehelix palette in in a string, prefixed with "ch:"
(e.g. "ch:-.1,.2,l=.7"
). Note that keyword arguments can be spelled out or referenced using only their first letter. Reversing the palette is accomplished by appending "_r"
, as with other matplotlib colormaps. This specification will be accepted by any seaborn function with a palette=
parameter.plotting_context()
and increased the scaling factors for "talk"
and "poster"
contexts.set()
will now call set_color_codes()
to re-assign the single letter color codes by defaultA few functions have been renamed or have had changes to their default parameters.
factorplot
function has been renamed to catplot()
. The new name ditches the original R-inflected terminology to use a name that is more consistent with terminology in pandas and in seaborn itself. This change should hopefully make catplot()
easier to discover, and it should make more clear what its role is. factorplot
still exists and will pass its arguments through to catplot()
with a warning. It may be removed eventually, but the transition will be as gradual as possible.factorplot
name was changed was to ease another alteration which is that the default kind
in catplot()
is now "strip"
(corresponding to stripplot()
). This plots a categorical scatter plot which is usually a much better place to start and is more consistent with the default in relplot()
. The old default style in factorplot
("point"
, corresponding to pointplot()
) remains available if you want to show a statistical estimation.lvplot
function has been renamed to boxenplot()
. The “letter-value” terminology that was used to name the original kind of plot is obscure, and the abbreviation to lv
did not help anything. The new name should make the plot more discoverable by describing its format (it plots multiple boxes, also known as “boxen”). As with factorplot
, the lvplot
function still exists to provide a relatively smooth transition.size
parameter to height
in multi-plot grid objects (FacetGrid
, PairGrid
, and JointGrid
) along with functions that use them (factorplot
, lmplot()
, pairplot()
, and jointplot()
) to avoid conflicts with the size
parameter that is used in scatterplot
and lineplot
(necessary to make relplot()
work) and also makes the meaning of the parameter a bit more clear.pairplot()
to use func:kdeplot` when a "hue"
dimension is used.JointGrid
. The method is still available but will be removed in a future version.coefplot
and interactplot
, have undergone final removal from the code base.There has been some effort put into improving the documentation. The biggest change is that the introduction to the library has been completely rewritten to provide much more information and, critically, examples. In addition to the high-level motivation, the introduction also covers some important topics that are often sources of confusion, like the distinction between figure-level and axes-level functions, how datasets should be formatted for use in seaborn, and how to customize the appearance of the plots.
Other improvements have been made throughout, most notably a thorough re-write of the categorical tutorial.
rugplot()
to plot a matplotlib LineCollection
instead of many Line2D
objects, providing a big speedup for large arrays.scatterplot()
. (Note that the "hue"
currently draws three separate scatterplots instead of using the hue semantic of the scatterplot function).kdeplot()
with two variables. The default colormap for the 2D density now follows the color cycle, and the function can use color
and label
kwargs, adding more flexibility and avoiding a warning when using with multi-plot grids.subplot_kws
parameter to PairGrid
for more flexibility.PairGrid
that defaulted to drawing stacked histograms on the diagonal axes.jointplot()
/JointGrid
and regplot()
so that they now accept list inputs.FacetGrid
when using a single row/column level or using col_wrap=1
.pip
is aware of. This means that pip install seaborn
will now work in an empty environment. Additionally, the dependencies are specified with strict minimal versions.FacetGrid
when passing a categorical plot function without specifying order
(or hue_order
when hue
is used), which is likely to produce a plot that is incorrect.FacetGrid
or PairGrid
and interactive matplotlib backends so that the legend no longer remains inside the figure when using legend_out=True
.dark_palette()
instead of light_palette()
when generating a sequential palette from a specified color.kdeplot()
and distplot()
to data with fewer than two observations.clustermap()
when using yticklabels=False
.pointplot()
where colors were wrong if exactly three points were being drawn.pointplot()
where legend entries for missing data appeared with empty markers.clustermap()
where an error was raised when annotating the main heatmap and showing category colors.clustermap()
where row labels were not being properly rotated when they overlapped.kdeplot()
where the maximum limit on the density axes was not being updated when multiple densities were drawn.set()
or one or more of set_style()
, set_context()
, and set_palette()
. Correspondingly, the seaborn.apionly
module has been deprecated.heatmap()
(and by extension clustermap()
) when plotting divergent dataesets (i.e. when the center
parameter is used). Instead of extending the lower and upper limits of the colormap to be symmetrical around the center
value, the colormap is modified so that its middle color corresponds to center
. This means that the full range of the colormap will not be used (unless the data or specified vmin
and vmax
are symmetric), but the upper and lower limits of the colorbar will correspond to the range of the data. See the Github pull request (#1184) for examples of the behavior.heatmap()
(and by extension clustermap()
). If you want the colormap to be treated as diverging (see above), it is now necessary to specify the center
value. When no colormap is specified, specifying center
will still change the default to be one that is more appropriate for displaying diverging data.seaborn.cm
namespace.heatmap()
colormaps to be “rocket” (in the case of sequential data) or “icefire” (in the case of diverging data). Note that this change reverses the direction of the luminance ramp from the previous defaults. While potentially confusing and disruptive, this change better aligns the seaborn defaults with the new matplotlib default colormap (“viridis”) and arguably better aligns the semantics of a “heat” map with the appearance of the colormap."auto"
as a (default) option for tick labels in heatmap()
and clustermap()
. This will try to estimate how many ticks can be labeled without the text objects overlapping, which should improve performance for larger matrices.dodge
parameter to boxplot()
, violinplot()
, and barplot()
to allow use of hue
without changing the position or width of the plot elements, as when the hue
varible is not nested within the main categorical variable.split
parameter for stripplot()
and swarmplot()
has been renamed to dodge
for consistency with the other categorical functions (and for differentiation from the meaning of split
in violinplot()
).kdeplot()
with the cbar
parameter (and related cbar_ax
and cbar_kws
parameters).ci="sd"
.despine()
.jointplot()
for type=="hex"
to avoid hanging when the reference rule prescribes too many.heatmap()
. Instead of reversing the rows of the data internally, the y axis is now inverted. This may affect code that draws on top of the heatmap in data coordinates.clustermap()
rather than setting the background color to white.seaborn
namespace.tsplot()
function to indicate that it will be removed or replaced with a substantially altered version in a future release.interactplot
and coefplot
functions are officially deprecated and will be removed in a future release.barplot()
or pointplot()
(and, by extension, factorplot
). Additionally, the line width of the error bars can now be controlled. These changes involve the new parameters capsize
and errwidth
. See the github pull request (#898) for examples of usage.clustermap()
. It is now possible to pass Pandas objects for these elements and, when possible, the semantic information in the Pandas objects will be used to add labels to the plot. When Pandas objects are used, the color data is matched against the main heatmap based on the index, not on position. This is more accurate, but it may lead to different results if current code assumed positional matching.heatmap()
.annot
parameter of heatmap()
now accepts a rectangular dataset in addition to a boolean value. If a dataset is passed, its values will be used for the annotations, while the main dataset will be used for the heatmap cell colors.FacetGrid
that appeared when using col_wrap
with missing col
levels.heatmap()
colorbar.PairGrid
histograms when there are multiple hue levels.reset_orig()
function (and, by extension, importing seaborn.apionly
) resets matplotlib rcParams to their values at the time seaborn itself was imported, which should work better with rcParams changed by the jupyter notebook backend.seaborn
namespace.FacetGrid
.This is a major release from 0.6. The main new feature is swarmplot()
which implements the beeswarm approach for drawing categorical scatterplots. There are also some performance improvements, bug fixes, and updates for compatibility with new versions of dependencies.
swarmplot()
function, which draws beeswarm plots. These are categorical scatterplots, similar to those produced by stripplot()
, but position of the points on the categorical axis is chosen to avoid overlapping points. See the categorical plot tutorial for more information.stripplot()
defaults to be closer to swarmplot()
. Points are now somewhat smaller, have no outlines, and are not split by default when using hue
. These settings remain customizable through function parameters.{*_}order
parameter, and variables with a category
datatype will still follow the category order even if the levels are strictly numerical.stripplot()
draws points when using hue
nesting with split=False
so that the different hue
levels are not drawn strictly on top of each other.clustermap()
.font.size
to the plotting context definition so that the default output from plt.text
will be scaled appropriately.clustermap()
when fastcluster
is not installed.clustermap()
.distplot()
where sometimes the default number of bins would not be an integer.stripplot()
where a legend item would not appear for a hue
level if there were no observations in the first group of points.heatmap()
cell would be annotated on some matplotlib backends.This is a major release from 0.5. The main objective of this release was to unify the API for categorical plots, which means that there are some relatively large API changes in some of the older functions. See below for details of those changes, which may break code written for older versions of seaborn. There are also some new functions (stripplot()
, and countplot()
), numerous enhancements to existing functions, and bug fixes.
Additionally, the documentation has been completely revamped and expanded for the 0.6 release. Now, the API docs page for each function has multiple examples with embedded plots showing how to use the various options. These pages should be considered the most comprehensive resource for examples, and the tutorial pages are now streamlined and oriented towards a higher-level overview of the various features.
In version 0.6, the “categorical” plots have been unified with a common API. This new category of functions groups together plots that show the relationship between one numeric variable and one or two categorical variables. This includes plots that show distribution of the numeric variable in each bin (boxplot()
, violinplot()
, and stripplot()
) and plots that apply a statistical estimation within each bin (pointplot()
, barplot()
, and countplot()
). There is a new tutorial chapter that introduces these functions.
The categorical functions now each accept the same formats of input data and can be invoked in the same way. They can plot using long- or wide-form data, and can be drawn vertically or horizontally. When long-form data is used, the orientation of the plots is inferred from the types of the input data. Additionally, all functions natively take a hue
variable to add a second layer of categorization.
With the (in some cases new) API, these functions can all be drawn correctly by FacetGrid
. However, factorplot
can also now create faceted verisons of any of these kinds of plots, so in most cases it will be unnecessary to use FacetGrid
directly. By default, factorplot
draws a point plot, but this is controlled by the kind
parameter.
Here are details on what has changed in the process of unifying these APIs:
boxplot()
and violinplot()
will probably be the most disruptive. Both functions maintain backwards-compatibility in terms of the kind of data they can accept, but the syntax has changed to be more similar to other seaborn functions. These functions are now invoked with x
and/or y
parameters that are either vectors of data or names of variables in a long-form DataFrame passed to the new data
parameter. You can still pass wide-form DataFrames or arrays to data
, but it is no longer the first positional argument. See the github pull request (#410) for more information on these changes and the logic behind them.pointplot()
and barplot()
can now plot with the major categorical variable on the y axis, the x_order
parameter has been renamed to order
.hue
argument to boxplot()
and violinplot()
, which allows for nested grouping the plot elements by a third categorical variable. For violinplot()
, this nesting can also be accomplished by splitting the violins when there are two levels of the hue
variable (using split=True
). To make this functionality feasible, the ability to specify where the plots will be draw in data coordinates has been removed. These plots now are drawn at set positions, like (and identical to) barplot()
and pointplot()
.palette
parameter to boxplot()
/violinplot()
. The color
parameter still exists, but no longer does double-duty in accepting the name of a seaborn palette. palette
supersedes color
so that it can be used with a FacetGrid
.Along with these API changes, the following changes/enhancements were made to the plotting functions:
Series.unique()
). Order can be specified when plotting with the order
and hue_order
parameters. Additionally, when variables are pandas objects with a “categorical” dtype, the category order is inferred from the data object. This change also affects FacetGrid
and PairGrid
.scale
and scale_hue
parameters to violinplot()
. These control how the width of the violins are scaled. The default is area
, which is different from how the violins used to be drawn. Use scale='width'
to get the old behavior.box
kind of interior plot in violinplot()
, which shows the whisker range in addition to the quartiles. Use inner='quartile'
to get the old style.stripplot()
function, which draws a scatterplot where one of the variables is categorical. This plot has the same API as boxplot()
and violinplot()
. It is useful both on its own and when composed with one of these other plot kinds to show both the observations and underlying distribution.countplot()
function, which uses a bar plot representation to show counts of variables in one or more categorical bins. This replaces the old approach of calling barplot()
without a numeric variable.corrplot()
and underlying symmatplot()
functions have been deprecated in favor of heatmap()
, which is much more flexible and robust. These two functions are still available in version 0.6, but they will be removed in a future version.set_color_codes()
function and the color_codes
argument to set()
and set_palette()
. This changes the interpretation of shorthand color codes (i.e. “b”, “g”, k”, etc.) within matplotlib to use the values from one of the named seaborn palettes (i.e. “deep”, “muted”, etc.). That makes it easier to have a more uniform look when using matplotlib functions directly with seaborn imported. This could be disruptive to existing plots, so it does not happen by default. It is possible this could change in the future.color_palette()
function no longer trims palettes that are longer than 6 colors when passed into it.as_hex
method to color palette objects, to return a list of hex codes rather than rgb tuples.jointplot()
now passes additional keyword arguments to the function used to draw the plot on the joint axes.linewidths
in heatmap()
and clustermap()
to 0 so that larger matrices plot correctly. This parameter still exists and can be used to get the old effect of lines demarcating each cell in the heatmap (the old default linewidths
was 0.5).heatmap()
and clustermap()
now automatically use a mask for missing values, which previously were shown with the “under” value of the colormap per default plt.pcolormesh behavior.seaborn.crayons
dictionary and the crayon_palette()
function to define colors from the 120 box (!) of Crayola crayons.line_kws
parameter to residplot()
to change the style of the lowess line, when used.**kwargs
to the add_legend
method on FacetGrid
and PairGrid
, which will pass additional keyword arguments through when calling the legend function on the Figure
or Axes
.gridspec_kws
parameter to FacetGrid
, which allows for control over the size of individual facets in the grid to emphasize certain plots or account for differences in variable ranges.pairplot()
and PairGrid
is now slightly smaller.shade_lowest
parameter to kdeplot()
which will set the alpha for the lowest contour level to 0, making it easier to plot multiple bivariate distributions on the same axes.height
parameter of rugplot()
is now interpreted as a function of the axis size and is invariant to changes in the data scale on that axis. The rug lines are also slightly narrower by default.distplot()
when calculating a default number of bins. For highly skewed data it will now use sqrt(n) bins, where previously the reference rule would return “infinite” bins and cause an exception in matplotlib.distplot()
histograms. This will help avoid confusing errors with certain kinds of datasets that heavily violate the assumptions of the reference rule used to get a default number of bins. The ceiling is not applied when passing a specific number of bins.plt.boxplot
are now applied after the seaborn restyling to allow for full customizability.savefig
method to JointGrid
that defaults to a tight bounding box to make it easier to save figures using this class, and set a tight bbox as the default for the savefig
method on other Grid objects.xticklabels
and yticklabels
parameter of heatmap()
(and, by extension, clustermap()
). This will make the plot use the ticklabels inferred from the data, but only plot every n
label, where n
is the number you pass. This can help when visualizing larger matrices with some sensible ordering to the rows or columns of the dataframe.load_dataset()
function now caches datasets locally after downloading them, and uses the local copy on subsequent calls.clustermap()
where the mask and specified ticklabels were not being reorganized using the dendrograms.FacetGrid
and PairGrid
that lead to incorrect legend labels when levels of the hue
variable appeared in hue_order
but not in the data.FacetGrid.set_xticklabels()
or FacetGrid.set_yticklabels()
when col_wrap
is being used.PairGrid
where the hue_order
parameter was ignored.despine()
that caused errors when trying to trim the spines on plots that had inverted axes or no ticks.margin_titles
option in FacetGrid
, which can now be used with a legend.This is a bugfix release that includes a workaround for an issue in matplotlib 1.4.2 and fixes for two bugs in functions that were new in 0.5.0.
heatmap()
where the mask was vertically reversed relative to the data.clustermap()
when using nested lists of side colors.This is a major release from 0.4. Highlights include new functions for plotting heatmaps, possibly while applying clustering algorithms to discover structured relationships. These functions are complemented by new custom colormap functions and a full set of IPython widgets that allow interactive selection of colormap parameters. The palette tutorial has been rewritten to cover these new tools and more generally provide guidance on how to use color in visualizations. There are also a number of smaller changes and bugfixes.
heatmap()
function for visualizing a matrix of data by color-encoding the values. See the docs for more information.clustermap()
function for clustering and visualizing a matrix of data, with options to label individual rows and columns by colors. See the docs for more information. This work was lead by Olga Botvinnik.lmplot()
and pairplot()
get a new keyword argument, markers
. This can be a single kind of marker or a list of different markers for each level of the hue
variable. Using different markers for different hues should let plots be more comprehensible when reproduced to black-and-white (i.e. when printed). See the github pull request (#323) for examples.FacetGrid
and PairGrid
, hue_kws
. This similarly lets plot aesthetics vary across the levels of the hue variable, but more flexibily. hue_kws
should be a dictionary that maps the name of keyword arguments to lists of values that are as long as the number of levels of the hue variable.subplot_kws
has been added to FacetGrid
. This allows for faceted plots with custom projections, including maps with Cartopy.light_palette()
function, which takes a seed color and creates a ramp from a very light, desaturated variant of it. For diverging palettes, you can use the diverging_palette()
function to create a balanced ramp between two endpoints to a light or dark midpoint. See the palette tutorial for more information.light_palette()
and dark_palette()
as a tuple of husl
or hls
space values or as a named xkcd
color. The interpretation of the seed color is now provided by the new input
parameter to these functions.choose_colorbrewer_palette()
, choose_light_palette()
, choose_dark_palette()
, and choose_diverging_palette()
. For consistency, renamed the cubehelix widget to choose_cubehelix_palette()
(and fixed a bug where the cubehelix palette was reversed). These functions also now return either a color palette list or a matplotlib colormap when called, and that object will be live-updated as you play with the widget. This should make it easy to iterate over a plot until you find a good representation for the data. See the Github pull request or this notebook (download it to use the widgets) for more information.PairGrid
that gave incorrect results (or a crash) when the input DataFrame has a non-default index.PairGrid
where passing columns with a date-like datatype raised an exception.lmplot()
would show a legend when the hue variable was also used on either the rows or columns (making the legend redundant).boxplot()
to appear as blue.kdeplot()
now accepts pandas Series for the data
and data2
arguments.corrplot()
now implies sig_stars=False
as the permutation test used to significance values for the correlations uses a pearson metric.pdf.fonttype
from the style definitions, as the value used in version 0.4 resulted in very large PDF files.This is a major release from 0.3. Highlights include new approaches for quick, high-level dataset exploration (along with a more flexible interface) and easy creation of perceptually-appropriate color palettes using the cubehelix system. Along with these additions, there are a number of smaller changes that make visualizing data with seaborn easier and more powerful.
PairGrid
, and a corresponding function pairplot()
, for drawing grids of pairwise relationships in a dataset. This style of plot is sometimes called a “scatterplot matrix”, but the representation of the data in PairGrid
is flexible and many styles other than scatterplots can be used. See the docs for more information. Note: due to a bug in older versions of matplotlib, you will have best results if you use these functions with matplotlib 1.4 or later."husl"
palette will be used to avoid cycling.hist_norm
to distplot()
. When a distplot()
is now drawn without a KDE or parametric density, the histogram is drawn as counts instead of a density. This can be overridden by by setting hist_norm
to True
.FacetGrid
with a hue
variable, the legend is no longer drawn by default when you call FacetGrid.map()
. Instead, you have to call FacetGrid.add_legend()
manually. This should make it easier to layer multiple plots onto the grid without having duplicated legends.factorplot
so that it behaves better when not all levels of the x
variable are represented in each facet.logx
option to regplot()
for fitting the regression in log space.violinplot()
encounters a bin with only a single observation, it will now plot a horizontal line at that value instead of erroring out.cubehelix_palette()
function for generating sequential palettes from the cubehelix system. See the palette docs for more information on how these palettes can be used. There is also the choose_cubehelix()
which will launch an interactive app to select cubehelix parameters in the notebook.xkcd_palette()
and the xkcd_rgb
dictionary so that colors can be specified with names from the xkcd color survey.font_scale
option to plotting_context()
, set_context()
, and set()
. font_scale
can independently increase or decrease the size of the font elements in the plot.font.sans-serif
field to the axes_style
definition with Arial and Liberation Sans prepended to matplotlib defaults. The font family can also be set through the font
keyword argument in set()
. Due to matplotlib bugs, this might not work as expected on matplotlib 1.3.despine()
function gets a new keyword argument offset
, which replaces the deprecated offset_spines()
function. You no longer need to offset the spines before plotting data.pdf.fonttype
so that text in PDFs is editable in Adobe Illustrator.set_color_palette
and palette_context
functions. These were replaced in version 0.3 by the set_palette()
function and ability to use color_palette()
directly in a with
statement.nogrid
style, which was renamed to white
in 0.3.This is a minor release from 0.3 with fixes for several bugs.
pointplot()
and factorplot
are now scaled with the linewidth for better aesthetics across different plotting contexts.pointplot()
glyphs for different levels of the hue variable are drawn at different z-orders so that they appear uniform.FacetGrid
(and thus affecting lmplot and factorplot) that appeared when col_wrap
was used with a number of facets that did not evenly divide into the column width.hue
variable levels that were not strings were missing in FacetGrid
legends.with
statement, the entire palette is now used instead of the first six colors.This is a major release from 0.2 with a number of enhancements to the plotting capabilities and styles. Highlights include FacetGrid
, factorplot
, jointplot()
, and an overhaul to style management. There is also lots of new documentation, including an example gallery and reorganized tutorial.
FacetGrid
class adds a new form of functionality to seaborn, providing a way to abstractly structure a grid of plots corresponding to subsets of a dataset. It can be used with a wide variety of plotting functions (including most of the matplotlib and seaborn APIs. See the tutorial for more information.factorplot
function, which is similar in spirit to lmplot()
but intended for use when the main independent variable is categorical instead of quantitative. factorplot
can draw a plot in either a point or bar representation using the corresponding Axes-level functions pointplot()
and barplot()
(which are also new). Additionally, the factorplot
function can be used to draw box plots on a faceted grid. For examples of how to use these functions, you can refer to the tutorial.jointplot()
, which is built using the new JointGrid
object. jointplot()
generalizes the behavior of regplot()
in previous versions of seaborn (regplot()
has changed somewhat in 0.3; see below for details) by drawing a bivariate plot of the relationship between two variables with their marginal distributions drawn on the side of the plot. With jointplot()
, you can draw a scatterplot or regression plot as before, but you can now also draw bivariate kernel densities or hexbin plots with appropriate univariate graphs for the marginal distributions. Additionally, it’s easy to use JointGrid
directly to build up more complex plots when the default methods offered by jointplot()
are not suitable for your visualization problem. The tutorial for JointGrid
has more examples of how this object can be useful.residplot()
function complements regplot()
and can be quickly used to diagnose problems with a linear model by calculating and plotting the residuals of a simple regression. There is also a "resid"
kind for jointplot()
.regplot()
no longer produces a multi-component plot with distributions in marginal axes. Instead. regplot()
is now an “Axes-level” function that can be plotted into any existing figure on a specific set of axes. regplot()
and lmplot()
have also been unified (the latter uses the former behind the scenes), so all options for how to fit and represent the regression model can be used for both functions. To get the old behavior of regplot()
, use jointplot()
with kind="reg"
.lmplot()
has been rewritten to exploit the FacetGrid
machinery. This involves a few changes. The color
keyword argument has been replaced with hue
, for better consistency across the package. The hue
parameter will always take a variable name, while color
will take a color name or (in some cases) a palette. The lmplot()
function now returns the FacetGrid
used to draw the plot instance.axes_style()
and set_style()
, plotting_context()
and set_context()
, and color_palette()
and set_palette()
. In each case, the pairs take the exact same arguments. The first function defines and returns the parameters, and the second sets the matplotlib defaults. Additionally, the first function in each pair can be used in a with
statement to temporarily change the defaults. Both the style and context functions also now accept a dictionary of matplotlib rc parameters to override the seaborn defaults, and set()
now also takes a dictionary to update any of the matplotlib defaults. See the tutorial for more information.nogrid
style has been deprecated and changed to white
for more uniformity (i.e. there are now darkgrid
, dark
, whitegrid
, and white
styles).import seaborn.apionly as sns
or from seaborn.apionly import lmplot
, etc. This is using the (also new) reset_orig()
function, which returns the rc parameters to what they are at matplotlib import time — i.e. they will respect any custom matplotlibrc settings on top of the matplotlib defaults.numpy
, scipy
, matplotlib
, and pandas
. Although statsmodels
is still recommended for full functionality, it is not required.lmplot()
(and regplot()
) have two new options for fitting regression models: lowess
and robust
. The former fits a nonparametric smoother, while the latter fits a regression using methods that are less sensitive to outliers.lmplot()
and regplot()
is now estimated with fewer bootstrap iterations, so plotting should be faster.kdeplot()
can now be drawn as a cumulative density plot.interactplot()
to use a robust calculation of the data range when finding default limits for the contour colormap to work better when there are outliers in the data.dark
, which shares most features with darkgrid
but does not draw a grid by default.offset_spines()
, and a corresponding option in despine()
called trim
. Together, these can be used to make plots where the axis spines are offset from the main part of the figure and limited within the range of the ticks. This is recommended for use with the ticks
style.This is a bugfix release, with no new features.
violinplot()
and boxplot()
when using a
Series
object as data and performing a groupby
to assign data to
bins to address a problem that arises in Pandas 0.13.groupby
code to work with all styles of group
specification (specifically, using a dictionary or a function now works).This is a major release from 0.1 with a number of API changes, enhancements, and bug fixes.
Highlights include an overhaul of timeseries plotting to work intelligently
with dataframes, the new function interactplot()
for visualizing continuous
interactions, bivariate kernel density estimates in kdeplot()
, and
significant improvements to color palette handling.
Version 0.2 also introduces experimental support for Python 3.
In addition to the library enhancements, the documentation has been substantially rewritten to reflect the new features and improve the presentation of the ideas behind the package.
tsplot()
function was rewritten to accept data in a long-form
DataFrame
and to plot different traces by condition. This introduced a
relatively minor but unavoidable API change, where instead of doing
sns.tsplot(time, heights)
, you now must do sns.tsplot(heights,
time=time)
(the time
parameter is now optional, for quicker
specification of simple plots). Additionally, the "obs_traces"
and
"obs_points"
error styles in tsplot()
have been renamed to
"unit_traces"
and "unit_points"
, respectively.kdeplot()
and
violinplot()
) now use statsmodels
instead of scipy
, and the
parameters that influence the density estimate have changed accordingly. This
allows for increased flexibility in specifying the bandwidth and kernel, and
smarter choices for defining the range of the support. Default options should
produce plots that are very close to the old defaults.kdeplot()
function now takes a second positional argument of data for
drawing bivariate densities.violin()
function has been changed to violinplot()
, for consistency.
In 0.2, violin
will still work, but it will fire a UserWarning
.interactplot()
function draws a contour plot for an interactive
linear model (i.e., the contour shows y-hat
from the model y ~ x1 *
x2
) over a scatterplot between the two predictor variables. This plot
should aid the understanding of an interaction between two continuous
variables.kdeplot()
function can now draw a bivariate density estimate as a
contour plot if provided with two-dimensional input data.palplot()
function provides a simple grid-based visualization of a
color palette.corrplot()
function can be drawn without the correlation coefficient
annotation and with variable names on the side of the plot to work with large
datasets.corrplot()
sets the color palette intelligently based on
the direction of the specified test.distplot()
histogram uses a reference rule to choose the bin size if it
is not provided.x_bins
option in lmplot()
for binning a continuous
predictor variable, allowing for clearer trends with many datapoints.name
attributes in several distribution plot functions and tsplot()
for
smarter Pandas integration.lmplot()
are slightly transparent so it is easy to see
where observations overlap.order
parameter to boxplot()
and violinplot()
to
control the order of the bins when using a Pandas object.ax
argument is not provided to a plotting function, it grabs the
currently active axis instead of drawing a new one.dark_palette()
and blend_palette()
for on-the-fly creation
of blended color palettes.Set1
, Paired
, etc.), which are properly treated as discrete.deep
, muted
, etc.) have been standardized in
terms of basic hue sequence, and all palettes now have 6 colors.{mpl_palette}_d
palettes, which make a palette with the basic
color scheme of the source palette, but with a sequential blend from dark
instead of light colors for use with line/scatter/contour plots.palette_context()
function for blockwise color palettes
controlled by a with
statement.despine()
function for easily removing plot spines."ticks"
has been added.plotobjs
module
into smaller modules grouped by general objective of the constituent plots.scikits-learn
dependency in moss
.pip
should automatically install most missing dependencies.boxplot()
and violinplot()
when using a groupby.desaturate()
function.coefplot()
figure size calculation.regplot()
choked on list input.distplot()
histogram now works.kdeplot()
would reset the axis height and cut off
existing data.seaborn.set()
function, so context or color palette can be cleanly changed.