-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
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
Conversation
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) |
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.
It changes current default?
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.
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.
@danfrankj this needs tests. ok with changing to match |
@jreback not exactly sure what a unit test for this kind of option would look like. |
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. |
closing pls reopen if/when updated |
|
sharex and sharey should be settable and by default False in a grouped boxplot. E.g.