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

Another matplotlib deprecation warning #397

Open
mperrin opened this issue Feb 22, 2021 · 0 comments
Open

Another matplotlib deprecation warning #397

mperrin opened this issue Feb 22, 2021 · 0 comments
Milestone

Comments

@mperrin
Copy link
Collaborator

mperrin commented Feb 22, 2021

This arises in part of the display code, when calling e.g. some_instrument.calc_psf(display=True):

/Users/mperrin/software/poppy/poppy/poppy_core.py:518: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.

Usually that shows up over and over again for each wavelength in a polychromatic calculation.

The original behavior and intent of this part of the code was to re-plot each wavelength as it's calculated, in a plot window that is updated again for each wavelength, overwriting the previous plots and reusing the axes for each wavelength. This doesn't achieve much now with the Jupyter framework in which plots are just sent at the end of the whole cell running. (It maybe still behaves in the original way if used in one of the interactive backends like TkAgg? Not sure!)

We either need to make this smarter about axes to avoid that matplotlib deprecation warning, or else completely shortcut around the re-plotting if using the Jupyter backend, and just plot one wavelength for instance.

@mperrin mperrin added this to the 1.1.0 milestone Jul 20, 2021
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

No branches or pull requests

1 participant