Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Simplifications to errorbar(). #15037

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 1 commit into from
May 27, 2020
Merged

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Aug 12, 2019

  • Move check that x and y have same size to top.
  • Replace xywhere by a more general mask-application function; then, in
    the various xlolims/xuplims/... handling blocks, apply all masks at
    once.
  • Apply xlolims/xuplims in extract_err, which allows drawing all
    errorbars in a single call to vlines()/hlines().
  • We don't need to check the size of lolims/uplims because they go
    through broadcast() earlier.
  • Clarify the docstring a bit.

tbh, based on the somewhat debatable interpretation of lolims/uplims (should it be uplims/lolims? -- see docstring edit), the lack of anyone ever mentioning that, and the fact that their interpretation was inverted in #2452 with no apparent complaints, I believe it's likely that this feature (https://matplotlib.org/gallery/lines_bars_and_markers/errorbar_limits_simple.html) is extremely rarely used and may be worth shedding away, given the complexity of the implementation...

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

@anntzer
Copy link
Contributor Author

anntzer commented May 22, 2020

rebased

@anntzer anntzer force-pushed the simplify-errorbar branch from 35a298d to 9c1c242 Compare May 23, 2020 14:38
@anntzer
Copy link
Contributor Author

anntzer commented May 23, 2020

yup, handled.

Copy link
Member

@efiring efiring left a comment

Choose a reason for hiding this comment

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

It makes a horribly complicated method a little cleaner.

- Move check that x and y have same size to top.
- Replace xywhere by a more general mask-application function; then, in
  the various xlolims/xuplims/... handling blocks, apply all masks at
  once.
- Apply xlolims/xuplims in extract_err, which allows drawing all
  errorbars in a single call to vlines()/hlines().
- We don't need to check the size of lolims/uplims because they go
  through broadcast() earlier.
- Clarify the docstring a bit.
@anntzer anntzer force-pushed the simplify-errorbar branch from 9c1c242 to c24b1af Compare May 26, 2020 05:37
@QuLogic QuLogic merged commit 8e569e9 into matplotlib:master May 27, 2020
@anntzer anntzer deleted the simplify-errorbar branch May 27, 2020 07:05
vlas-sokolov pushed a commit to vlas-sokolov/matplotlib that referenced this pull request Jun 18, 2020
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.

5 participants