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

BUG: calculate colorbar boundaries correctly from values #13114

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
Jan 6, 2019

Conversation

efiring
Copy link
Member

@efiring efiring commented Jan 6, 2019

Closes #13098.
The unusual case of a call to colorbar with specified values
occurs in test_colorbar.py test_colorbar_closed_patch. The
effect of the bug there was to disable the ticks; but
evidently this was considered a feature, because the example
image was made with the bug in place, hence with no ticks on
the colorbars. Therefore I have modified the test code to
explicitly disable the ticks, so the test images don't have
to be changed.

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

Closes matplotlib#13098.
The unusual case of a call to colorbar with specified values
occurs in test_colorbar.py test_colorbar_closed_patch.  The
effect of the bug there was to disable the ticks; but
evidently this was considered a feature, because the example
image was made with the bug in place, hence with no ticks on
the colorbars.  Therefore I have modified the test code to
explicitly disable the ticks, so the test images don't have
to be changed.
Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

Hard to understand how this ever worked.

@efiring
Copy link
Member Author

efiring commented Jan 6, 2019

It didn't--but the only test that went through that code path was oblivious to the fact that the ticks were missing as a result of the bug. I suspect I originally put the code in to make the class as general as possible, but it was not exercised in any normal use case. It could be removed entirely by disallowing the values kwarg in the case where boundaries are not also specified, and by changing the test that exercises that case. That would actually make the docstring a little more complicated, though. It might also make some other parts of the code more complicated; it's far from clear to me that it would be a net gain, without being part of a thorough rewriting of the colorbar code.

@timhoffm timhoffm merged commit a2e251a into matplotlib:master Jan 6, 2019
@QuLogic QuLogic added this to the v3.1 milestone Jan 6, 2019
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.

Likely incorrect code(?) in colorbar.py
4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.