-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Let boxplot() defer rcParams application to bxp() #13449
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
instead of duplicating the defaults-applying code in both methods. This caught an oversight in the application of the boxplot.boxprops.linewidth rcParam in bxp (see changelog note); because of that, the bxp testing code needed some update (to keep the old behavior). Preliminary work to having bxp() normalize properties passed in the boxprops, meanprops, etc. kwargs as well.
8c17fd7
to
47d75f2
Compare
lib/matplotlib/axes/_axes.py
Outdated
markersize=rcParams['boxplot.flierprops.markersize'], | ||
) | ||
|
||
# cap properties |
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.
For me, it takes enough mental bandwidth to read these dict-comprehensions that I wonder if factoring out into a sub function makes sense
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.
pushed a second commit that does it, indeed that's a good idea.
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.
ahhh it looks great.
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 is a good catch and needed. Thanks don't let any of my comments hold this up. Thanks @anntzer !
@@ -2108,68 +2108,59 @@ def layers(n, m): | ||
axs[1, 1].stackplot(range(100), d.T, baseline='weighted_wiggle') | ||
|
||
|
||
def _bxp_test_helper( | ||
stats_kwargs={}, transform_stats=lambda s: s, bxp_kwargs={}): |
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 isn't a big deal. feel free to ignore it. but my early morning, uncaffeinated brain has a hard time with function definitions whose first parameters is on a second line
ax.set_xscale('log') | ||
# Work around baseline images generate back when bxp did not respect the | ||
# boxplot.boxprops.linewidth rcParam when patch_artist is False. | ||
if not bxp_kwargs.get('patch_artist', False): |
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.
OK, but you never test the new proper behaviour this way, do you?
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.
indeed. slightly changed the test setup to test that the rc is used.
84bdc71
to
2b8aee2
Compare
instead of duplicating the defaults-applying code in both methods.
This caught an oversight in the application of the
boxplot.boxprops.linewidth rcParam in bxp (see changelog note);
because of that, the bxp testing code needed some update (to keep the
old behavior).
Preliminary work to having bxp() normalize properties passed in the
boxprops, meanprops, etc. kwargs as well (#13448).
PR Summary
PR Checklist