Skip to content

FIX: colorbar check for constrained layout #10594

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 2 commits into from
Feb 25, 2018

Conversation

jklymak
Copy link
Member

@jklymak jklymak commented Feb 25, 2018

PR Summary

Fixes #10582

import matplotlib.pyplot as plt
import numpy as np

gx = np.linspace(-5, 5, 10)
img = np.hypot(gx, gx[:, None])

fig = plt.figure()
ax = fig.add_axes([0, 0, 1, 1])
mesh = ax.pcolormesh(gx, gx, img)
plt.colorbar(mesh)

plt.show()

failed with an attribute error. This is the most straightforward way of checking for that.

Not sure if this should have a test or not. Seems that maybe pyplot-created colorbars are not tested if this one got through the test suite...

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 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

@jklymak jklymak requested a review from dopplershift February 25, 2018 01:26
@jklymak jklymak added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Feb 25, 2018
@jklymak jklymak added this to the v2.2.0 milestone Feb 25, 2018
@jklymak
Copy link
Member Author

jklymak commented Feb 25, 2018

... interestingly there is no test_pyplot. Are we to check the pyplot interface in the relevant subsections? Seems ripe for someone to come along, convert to non-pyplot, and destroy the test.

@jklymak
Copy link
Member Author

jklymak commented Feb 25, 2018

Test added to constrained_layout

@efiring efiring merged commit 03b8e19 into matplotlib:master Feb 25, 2018
tacaswell added a commit that referenced this pull request Feb 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Creating colorbar for manual axes broken
3 participants