Skip to content

boxplot() return type #623

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

Closed
cachitas opened this issue Jul 3, 2015 · 2 comments
Closed

boxplot() return type #623

cachitas opened this issue Jul 3, 2015 · 2 comments

Comments

@cachitas
Copy link

cachitas commented Jul 3, 2015

Is it possible to access the boxplot to further modify it?
Currently boxplot() returns the Axes.

I would like to paint the boxes differently along x while having an hue coded with a pattern, and I'm trying to achieve this hacking around... (question here)

Pandas addresses this by having an argument return_type (see here).

@mwaskom
Copy link
Owner

mwaskom commented Jul 3, 2015

You can pass {artist}props dictionaries to boxplot which are applied after the seaborn attributes. Also, references to the various artists are stored on the Axes object, you just have to know where to look. Then you can work with them directly.

The idea that Axes-level functions in seaborn return the Axes the plot is on is fundamental and will not change.

@cachitas
Copy link
Author

cachitas commented Jul 4, 2015

I understand your point.
It is a matplotlib 'problem' then, to know where to look. I have played with the get_lines() but it is a bit messy. Also thank you for your answer on SO: ax.artists gives me access to the boxes indeed. I am guessing that the lines will give me the whiskers and the caps, but it is not very clear.
Anyway, thank you for the directions!

Meanwhile, I have managed to get the desired plot by using matplotlib only... No seaborn love involved but it got the job done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants