Skip to content
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

BUG: matplotlib 3.5 breaks colorbars #3554

Closed
neutrinoceros opened this issue Oct 12, 2021 · 2 comments · Fixed by #3556
Closed

BUG: matplotlib 3.5 breaks colorbars #3554

neutrinoceros opened this issue Oct 12, 2021 · 2 comments · Fixed by #3556
Milestone

Comments

@neutrinoceros
Copy link
Member

Bug report

Bug summary

Matplotlib has seen a lot of internal changes for colorbars between 3.4 and 3.5, some of which have minor yet noticeable consequences for yt

This is seen in daily jobs on Jenkins (latest_deps) since we allowed pre-releases to install
for instance the test yt.geometry.coordinates.tests.test_cylindrical_coordinates.GenericImage_AMRGridData_all_create_image_None_None
(see here https://tests.yt-project.org/job/yt_py38_latest_deps/389/testReport/junit/yt.geometry.coordinates.tests/test_cylindrical_coordinates/GenericImage_AMRGridData_all_create_image_None_None/)

Code for reproduction

Actual outcome

tmprwnn5eiu

Expected outcome
tmphtg06g_w

Version Information

  • Operating System:
  • Python Version:
  • yt version: main
  • Other Libraries (if applicable): matplotlib 3.5rc1

This bug is akin to the one I solved for symlog norms already #3536 (comment)

@neutrinoceros
Copy link
Member Author

Here's a self-contained example to reproduce the issue

import yt
import matplotlib

ds = yt.testing.fake_amr_ds(fields=[("gas", "density")], units=["g/cm**3"], geometry="polar")
yt.testing.add_noise_fields(ds)
p = yt.SlicePlot(ds, "z", "noise2")

p.save(f"/tmp/cb_mpl_v{matplotlib.__version__}.png")

outputs

with matplotlib 3.4.3

cb_mpl_v3 4 3

with matplotlib 3.5.0rc1

cb_mpl_v3 5 0rc1

@neutrinoceros
Copy link
Member Author

note that the case vmin < 0 and vmax > 0 works as intended, as can be shown using the noise3 field:

import yt
import matplotlib

ds = yt.testing.fake_amr_ds(fields=[("gas", "density")], units=["g/cm**3"], geometry="polar")
yt.testing.add_noise_fields(ds)
p = yt.SlicePlot(ds, "z", "noise3")

p.save(f"/tmp/cb_mpl_v{matplotlib.__version__}.png")

cb_mpl_v3 5 0rc1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant