Skip to content

Add sharex and sharey to grouped boxplot #8008

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
wants to merge 1 commit into from

Conversation

danfrankj
Copy link
Contributor

sharex and sharey should be settable and by default False in a grouped boxplot. E.g.

n [97]: df = DataFrame(np.random.rand(10,2), columns=['Col1', 'Col2'] )

In [98]: df['X'] =['A','A','A','A','A','B','B','B','B','B']

In [99]: df.iloc[0:5, :2] += 10000

In [100]: df.groupby('X').boxplot()  # this is unreadable

sharex and sharey should be settable and by default False in a grouped boxplot. E.g. 

In [97]: df = DataFrame(np.random.rand(10,2), columns=['Col1', 'Col2'] )

In [98]: df['X'] =['A','A','A','A','A','B','B','B','B','B']

In [99]: df.iloc[0:5, :2] += 10000

In [100]: df.groupby('X').boxplot()  # this is unreadable
@@ -2732,7 +2734,7 @@ def boxplot_frame_groupby(grouped, subplots=True, column=None, fontsize=None,
naxes = len(grouped)
nrows, ncols = _get_layout(naxes, layout=layout)
fig, axes = _subplots(nrows=nrows, ncols=ncols, naxes=naxes, squeeze=False,
ax=ax, sharex=False, sharey=True, figsize=figsize)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It changes current default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does change the default ... (not to would be to have sharex default to False and sharey default to True). But I changed this to match DataFrame.hist and it makes more sense anyways. Let me know if I should change it to not modify the current default.

@jreback
Copy link
Contributor

jreback commented Aug 13, 2014

@danfrankj this needs tests. ok with changing to match DataFrame.hist

@danfrankj
Copy link
Contributor Author

@jreback not exactly sure what a unit test for this kind of option would look like.

@jreback
Copy link
Contributor

jreback commented Aug 13, 2014

take a look here: https://github.com/pydata/pandas/blob/master/pandas/tests/test_graphics.py

you need to test for the correctness, e.g. you say sharey=..., the returned axes then should be shared, etc.

@jreback jreback modified the milestone: Next Major Release Mar 2, 2015
@jreback
Copy link
Contributor

jreback commented May 9, 2015

closing pls reopen if/when updated

@jreback jreback closed this May 9, 2015
@sinhrks
Copy link
Member

sinhrks commented May 9, 2015

boxplot is being replaced to plot(kind='box'), and hopefully #8018 can cover grouped cases.

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

Successfully merging this pull request may close these issues.

3 participants