Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Merged
merged 3 commits into from
Feb 22, 2019

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Feb 16, 2019

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

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

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.
markersize=rcParams['boxplot.flierprops.markersize'],
)

# cap properties
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

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

ahhh it looks great.

Copy link
Member

@phobson phobson left a 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={}):
Copy link
Member

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):
Copy link
Member

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?

Copy link
Contributor Author

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.

@jklymak jklymak merged commit cf6f1af into matplotlib:master Feb 22, 2019
@jklymak jklymak added this to the v3.1.0 milestone Feb 22, 2019
@anntzer anntzer deleted the boxplot-defaults branch February 22, 2019 22:40
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

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.