Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul of categorical distribution plots #410

Merged
merged 44 commits into from
Jan 22, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
6c59226
Initial groundwork for _BoxPlotter class
mwaskom Dec 27, 2014
69ecbb7
Fix category dtype test for older pandas
mwaskom Dec 27, 2014
79937f9
Round out variable determination and add tests
mwaskom Dec 28, 2014
e80f874
Fix long-form variable establishment and add basic plotting routine
mwaskom Dec 29, 2014
72eb3ee
Fix and finalize boxplot variable tests
mwaskom Dec 29, 2014
565b74b
Round out boxplot code, still needs tests
mwaskom Jan 7, 2015
486cab1
Add tests for boxplot colors
mwaskom Jan 7, 2015
b572e0f
Add legend support and NA removal
mwaskom Jan 7, 2015
98f8b2a
Add tests for box positioning
mwaskom Jan 7, 2015
b441d9d
Add tests for boxplot plot elements
mwaskom Jan 7, 2015
24028c1
Make infer_orient a regular method
mwaskom Jan 10, 2015
c58479a
Implement much of new violinplot
mwaskom Jan 12, 2015
4ee5a3f
Add stripplot
mwaskom Jan 14, 2015
f7c4107
More messy violinplot code
mwaskom Jan 14, 2015
922960b
Reorganize vestigal code
mwaskom Jan 14, 2015
5704a9e
Implement tests for density scaling
mwaskom Jan 14, 2015
715b025
Add test for violin widths
mwaskom Jan 14, 2015
0f53358
Convert some example dataset columns to categorical on load
mwaskom Jan 15, 2015
ac5a43a
Add high-level control over point aestetics to stripplot
mwaskom Jan 15, 2015
8b0a33f
Refactor single obs drawing out of main violin method
mwaskom Jan 15, 2015
9dde090
Add test coverage for special cases in violin density estimation
mwaskom Jan 15, 2015
fde3151
Begin implementing inner components of violin plots
mwaskom Jan 16, 2015
4dc062b
Implement interior plots for hue-nested violins
mwaskom Jan 16, 2015
4b24ebe
Invert the y axis for horizontally-oriented plots
mwaskom Jan 18, 2015
ccfb08f
Use a high zorder for stripplot to go over other distribution kinds
mwaskom Jan 18, 2015
7187a0f
Fix annotation test with inverted y axis
mwaskom Jan 18, 2015
8ac0c12
Test kde fit and density-limited line drawing
mwaskom Jan 18, 2015
c77b42a
Finish violinplot tests
mwaskom Jan 18, 2015
20470e2
Update boxplot/violinplot examples
mwaskom Jan 19, 2015
c7b361f
Add matplotlib plot_directive locally
mwaskom Jan 19, 2015
fe441ad
Tweak API doc configuration
mwaskom Jan 19, 2015
a576fc8
Add new boxplot docstring
mwaskom Jan 19, 2015
735732c
Remove box-type from factorplot for time being
mwaskom Jan 19, 2015
c70b475
Add docstring for new violinplot
mwaskom Jan 19, 2015
26278cc
Remove vestigal box and violinplot code
mwaskom Jan 19, 2015
832472d
Abstract more shared box/violinplot docstring text
mwaskom Jan 19, 2015
635d84d
Remove vestigal debugging image form tests
mwaskom Jan 19, 2015
a70dbe4
Remove old boxplot/violinplot cells from distributions notebook
mwaskom Jan 19, 2015
739cec6
Fix older scipy kde test
mwaskom Jan 19, 2015
bf6598c
Prune some plot tests
mwaskom Jan 19, 2015
d8bd0c8
Add stripplot docstring and update relase notes
mwaskom Jan 19, 2015
e8f35e2
Fix doctests that use FacetGrid and relase notes formatting
mwaskom Jan 19, 2015
bb8af70
Fix multiple identical observations with hue nesting
mwaskom Jan 19, 2015
eee0e7e
Update docstring examples for categorical distribution plots
mwaskom Jan 22, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/_static/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

blockquote {
blockquote p {
font-size: 14px !important;
}

Expand Down
1 change: 1 addition & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Distribution plots
jointplot
boxplot
violinplot
stripplot
distplot
kdeplot
rugplot
Expand Down
5 changes: 4 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
'sphinx.ext.mathjax',
'sphinx.ext.autosummary',
'plot_generator',
'plot_directive',
'numpydoc',
'ipython_directive',
'ipython_console_highlighting',
'matplotlib.sphinxext.plot_directive',
]

# Generate the API documentation when building
Expand All @@ -47,6 +47,9 @@

# Include the example source for plots in API docs
plot_include_source = True
plot_formats = [("png", 90)]
plot_html_show_formats = False
plot_html_show_source_link = False

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down
14 changes: 14 additions & 0 deletions doc/releases/v0.6.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
v0.6.0 (Unreleased)
-------------------

This is a major release from 0.5. The main objective of this release is to unify the API, which means there are some relatively large API changes in some of the older functions. See below for details of those changes, which will break code written for older versions of seaborn.

- Updated and unified the API for :func:`boxplot` and :func:`violinplot`. This is probably the most disruptive API change. Both functions maintain backwards-compatibility in terms of the kind of data they can accept, but the syntax has changed. These functions are now invoked with ``x``, ``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. The upshot of this is that both functions now work seamlessly in the context of a :class:`FacetGrid`. Additionally, by using named variables and a ``data`` object, it's much easier to apply transformations to the data in the body of the seaborn call. See the `github pull request <https://github.com/mwaskom/seaborn/pull/410>`_ for more information on these changes and the logic behind them.

- Added a ``hue`` argument to :func:`boxplot` and :func:`violinplot`, which allows for nested grouping the plot elements by a third categorical variable. For :func:`violinplot`, this nesting can also be accomplished by splitting the violins when there are two levels of the ``hue`` variable. 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) :func:`barplot` and :func:`pointplot`.

- Added a ``palette`` parameter to :func:`boxplot`/:func:`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 :class:`FacetGrid`.

- Added the ``scale`` and ``scale_hue`` parameters to :func:`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.

- Used a different style for the ``box`` kind of interior plot in :func:`violinplot`, which shows the whisker range in addition to the quartiles. Use ``inner='quartile'`` to get the old style.

- Added the :func:`stripplot` function, which draws a scatterplot where one of the variables is categorical. This plot has the same API as :func:`boxplot` and :func:`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.

- Added the ``line_kws`` parameter to :func:`residplot` to change the style of the lowess line, when used.

- Added a catch in :func:`distplot` when calculating a default number of bins. For highly skewed data it will now use 10 bins, where previously the reference rule would return "infinite" bins and cause an exception in matplotlib.
Expand Down
Loading