-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Unify categorical plots #466
Conversation
It would be great if people could pull this branch and throw all their weird, real-life data at it to check corner cases I may have missed with the test data/my own generally pretty clean experimental data. |
Just want to say that this + the fact that factor plot takes Huge |
What's your the timeline for this? I can maybe take a crack at the tutorials (separate branch & PR) while testing. But that'll definitely have to wait for later in the week spilling over into next week. |
The tutorial changes I have in mind are broader than just this PR -- now that I have an infrastructure for examples in the API docs, I want to move much of the nitty gritty stuff to there and make the tutorials more high-level and integrative. But I don't quite have a vision for what that will look like yet, so I'm not gonna hold up this PR for it. |
Something I am considering is changing |
This is a mess but I don't have time to finish it at the moment.
See matplotlib/matplotlib#4162 for details on bug in matplotlib on Python 3.4 that motivates this.
This addresses #445
This addresses #435.
This will include levels that appear in the `category` list, but that do not appear in the data. See #361
Was causing Travis failures for some reason.
4f34ba0
to
3575b2c
Compare
|
||
""" | ||
if order is None: | ||
if hasattr(values, "categories"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for reference: this only supports pandas >=0.15, in former versions Categorical.levels
have to be used...
This is a follow-on to #410. The majority of the changes are in terms of the implementation of things, but there are a few important new features and changes.
In short, the categorical distribution plots (
boxplot
,violinplot
andstripplot
) have been unified with the categorical estimation plots (barplot
,pointplot
, andcountplot
). From the user perspective, that means they all share a basic API. From the developer perspective, it means that as many common operations were abstracted out into the the underlying_CategoricalPlotter
and_CategoricalStatPlotter
classes. That means adding additional plot kinds in the future should be easier and more robust.Demonstration of major new features
The main highlight in terms of new functionality is that
barplot
andpointplot
can now draw horizontally:Additionally,
factorplot
can use any of the categorical plot kinds:API changes and new features
{bar,point,factor}_plot
is that thex_order
parameter has been renamed toorder
to reflect the fact that the categorical variable can be on the x or y axis.x
variable tobarplot
has been removed, but the newcountplot
function has been added to retain this functionality.FacetGrid
. That will likely be a different PR.hline
anddropna
scale
parameter to pointplot, which scales the point size and linewidths by a single factor.errcolor
parameter tobarplot
and also now pass extra**kwargs
down toplt.bar
.ax
property toFacetGrid
, which will give access to the main Axes in the case where there are norow
orcol
facets.data
.violinplot
andboxplot
legends is drawn to avoid errors when the first category has no data for a hue level.Linked issues:
This PR addresses several issues: #361, #416, #425, #435, #445, #448
Outstanding issues
countplot
needs some docstring examples