Releases: mwaskom/seaborn
v0.5.1 (November 2014)
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.
- Implemented a workaround for a bug in matplotlib 1.4.2 that
prevented point markers from being drawn when the seaborn styles had
been set. See this github
issue for more
information. - Fixed a bug in heatmap where the mask was vertically reversed
relative to the data. - Fixed a bug in clustermap when using nested lists of side colors.
v0.5.0 (November 2014)
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.
Plotting functions
- Added the heatmap function for visualizing a matrix of data by
color-encoding the values. See the docs for more
information. - Added the 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 thehue
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 for examples. - More generally, there is a new keyword argument in 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. - The argument
subplot_kws
has been added toFacetGrid
. This
allows for faceted plots with custom projections, including maps
with
Cartopy.
Color palettes
- Added two new functions to create custom color palettes. For
sequential palettes, you can use the 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 <palette_tutorial> for more information. - Added the ability to specify the seed color for light_palette and
dark_palette as a tuple ofhusl
orhls
space values or as a
namedxkcd
color. The interpretation of the seed color is now
provided by the newinput
parameter to these functions. - Added several new interactive palette widgets:
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. - Overhauled the color palette tutorial to
organize the discussion by class of color palette and provide more
motivation behind the various choices one might make when choosing
colors for their data.
Bug fixes
- Fixed a bug in PairGrid that gave incorrect results (or a crash)
when the input DataFrame has a non-default index. - Fixed a bug in PairGrid where passing columns with a date-like
datatype raised an exception. - Fixed a bug where lmplot would show a legend when the hue variable
was also used on either the rows or columns (making the legend
redundant). - Worked around a matplotlib bug that was forcing outliers in boxplot
to appear as blue. - kdeplot now accepts pandas Series for the
data
anddata2
arguments. - Using a non-default correlation method in corrplot now implies
sig_stars=False
as the permutation test used to significance
values for the correlations uses a pearson metric. - Removed
pdf.fonttype
from the style definitions, as the value used
in version 0.4 resulted in very large PDF files.
v0.4.0 (September 2014)
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.
Plotting functions
- A new object, 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. - The rules for choosing default color palettes when variables are
mapped to different colors have been unified (and thus changed in
some cases). Now when no specific palette is requested, the current
global color palette will be used, unless the number of variables to
be mapped exceeds the number of unique colors in the palette, in
which case the"husl"
palette will be used to avoid cycling. - Added a keyword argument
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
settinghist_norm
toTrue
. - When using 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. - Made some changes to factorplot so that it behaves better when not
all levels of thex
variable are represented in each facet. - Added the
logx
option to regplot for fitting the regression in log
space. - When violinplot encounters a bin with only a single observation, it
will now plot a horizontal line at that value instead of erroring
out.
Style and color palettes
- Added the 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. - Added the xkcd_palette and the
xkcd_rgb
dictionary so that colors
can be specified with names from the xkcd
color
survey. - Added the
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-handling should work better on systems without Arial installed.
This is accomplished by adding thefont.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. - The 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. - Added a default value for
pdf.fonttype
so that text in PDFs is
editable in Adobe Illustrator.
Other API Changes
- Removed the deprecated
set_color_palette
andpalette_context
functions. These were replaced in version 0.3 by the set_palette
function and ability to use color_palette directly in awith
statement. - Removed the ability to specify a
nogrid
style, which was renamed
towhite
in 0.3.
0.3.1 (April 2014)
This is a minor release from 0.3 with fixes for several bugs.
Plotting functions
- The size of the points in pointplot and factorplot is now scaled with the linewidth for better aesthetics across different plotting contexts.
- The pointplot glyphs for different levels of the hue variable are drawn at different z-orders so that they appear uniform.
Bug Fixes
- Fixed a bug in 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. - Fixed an issue where the support for kernel density estimates was sometimes computed incorrectly.
- Fixed a problem where
hue
variable levels that were not strings were missing in FacetGrid legends. - When passing a color palette list in a
with
statement, the entire palette is now used instead of the first six colors.
v0.3.0 (March 2014)
v0.3.0 (March 2014)
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.
New plotting functions
- The 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. - Version 0.3 introduces the 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. - Another new function is 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 or JointGrid has more examples of how this
object can be useful. - The 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.
API changes
- The most noticeable change will be that 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 withkind="reg"
. - As noted above, lmplot has been rewritten to exploit the FacetGrid
machinery. This involves a few changes. Thecolor
keyword argument
has been replaced withhue
, for better consistency across the
package. Thehue
parameter will always take a variable name,
whilecolor
will take a color name or (in some cases) a palette.
The lmplot function now returns the FacetGrid used to draw the plot
instance. - The functions that interact with matplotlib rc parameters have been
updated and standardized. There are now three pairs of functions,
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. - The
nogrid
style has been deprecated and changed towhite
for
more uniformity (i.e. there are nowdarkgrid
,dark
,whitegrid
,
andwhite
styles).
Other changes
Using the package
- If you want to use plotting functions provided by the package
without setting the matplotlib style to a seaborn theme, you can now
doimport 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. - The dependency load of the package has been reduced. It can now be
installed and used with onlynumpy
,scipy
,matplotlib
, and
pandas
. Althoughstatsmodels
is still recommended for full
functionality, it is not required.
Plotting functions
- lmplot (and regplot) have two new options for fitting regression
models:lowess
androbust
. The former fits a nonparametric
smoother, while the latter fits a regression using methods that are
less sensitive to outliers. - The regression uncertainty in lmplot and regplot is now estimated
with fewer bootstrap iterations, so plotting should be faster. - The univariate kdeplot can now be drawn as a cumulative density
plot. - Changed 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.
Style
- There is a new style,
dark
, which shares most features with
darkgrid
but does not draw a grid by default. - There is a new function, offset_spines, and a corresponding option
in despine calledtrim
. 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 theticks
style. - Other aspects of the seaborn styles have been tweaked for more
attractive plots.
v0.2.1 (January 2014)
This is a bugfix release, with no new features.
Bug fixes
- Changed the mechanics of
violinplot()
andboxplot()
when using a
Series
object as data and performing agroupby
to assign data to
bins to address a problem that arises in Pandas 0.13. - Additionally fixed the
groupby
code to work with all styles of group
specification (specifically, using a dictionary or a function now works). - Fixed a bug where artifacts from the kde fitting could undershoot and create
a plot where the density axis starts below 0. - Ensured that data used for kde fitting is double-typed to avoid a low-level
statsmodels error. - Changed the implementation of the histogram bin-width reference rule to
take a ceiling of the estimated number of bins.
v0.2.0 (December 2013)
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.
API changes
- The
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 doingsns.tsplot(time, heights)
, you now must do
sns.tsplot(heights, time=time)
(thetime
parameter is now
optional, for quicker specification of simple plots). Additionally,
the"obs_traces"
and"obs_points"
error styles intsplot()
have been renamed to"unit_traces"
and"unit_points"
,
respectively. - Functions that fit kernel density estimates (
kdeplot()
and
violinplot()
) now usestatsmodels
instead ofscipy
, 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. - The
kdeplot()
function now takes a second positional argument of
data for drawing bivariate densities. - The
violin()
function has been changed toviolinplot()
, for
consistency. In 0.2,violin
will still work, but it will fire a
UserWarning
.
New plotting functions
- The
interactplot()
function draws a contour plot for an
interactive linear model (i.e., the contour showsy-hat
from the
modely ~ x1 * x2
) over a scatterplot between the two predictor
variables. This plot should aid the understanding of an interaction
between two continuous variables. - The
kdeplot()
function can now draw a bivariate density estimate
as a contour plot if provided with two-dimensional input data. - The
palplot()
function provides a simple grid-based visualization
of a color palette.
Other changes
Plotting functions
- The
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. - Additionally,
corrplot()
sets the color palette intelligently
based on the direction of the specified test. - The
distplot()
histogram uses a reference rule to choose the bin
size if it is not provided. - Added the
x_bins
option inlmplot()
for binning a continuous
predictor variable, allowing for clearer trends with many
datapoints. - Enhanced support for labeling plot elements and axes based on
name
attributes in several distribution plot functions andtsplot()
for
smarter Pandas integration. - Scatter points in
lmplot()
are slightly transparent so it is easy
to see where observations overlap. - Added the
order
parameter toboxplot()
andviolinplot()
to
control the order of the bins when using a Pandas object. - When an
ax
argument is not provided to a plotting function, it
grabs the currently active axis instead of drawing a new one.
Color palettes
- Added the
dark_palette()
andblend_palette()
for on-the-fly
creation of blended color palettes. - The color palette machinery is now intelligent about qualitative
ColorBrewer palettes (Set1
,Paired
, etc.), which are properly
treated as discrete. - Seaborn color palettes (
deep
,muted
, etc.) have been
standardized in terms of basic hue sequence, and all palettes now
have 6 colors. - Introduced
{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. - Added the
palette_context()
function for blockwise color palettes
controlled by awith
statement.
Plot styling
- Added the
despine()
function for easily removing plot spines. - A new plot style,
"ticks"
has been added. - Tick labels are padded a bit farther from the axis in all styles,
avoiding collisions at (0, 0).
General package issues
- Reorganized the package by breaking up the monolithic
plotobjs
module into smaller modules grouped by general objective of the
constituent plots. - Removed the
scikits-learn
dependency inmoss
. - Installing with
pip
should automatically install most missing
dependencies. - The example notebooks are now used as an automated test suite.
Bug fixes
- Fixed a bug where labels did not match data for
boxplot()
and
violinplot()
when using a groupby. - Fixed a bug in the
desaturate()
function. - Fixed a bug in the
coefplot()
figure size calculation. - Fixed a bug where
regplot()
choked on list input. - Fixed buggy behavior when drawing horizontal boxplots.
- Specifying bins for the
distplot()
histogram now works. - Fixed a bug where
kdeplot()
would reset the axis height and cut
off existing data. - All axis styling has been moved out of the top-level
seaborn.set()
function, so context or color palette can be cleanly changed.