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

Use of deprecated function in center_colorbar #314

Closed
lkluft opened this issue Aug 22, 2019 · 1 comment · Fixed by #359
Closed

Use of deprecated function in center_colorbar #314

lkluft opened this issue Aug 22, 2019 · 1 comment · Fixed by #359
Assignees

Comments

@lkluft
Copy link
Member

lkluft commented Aug 22, 2019

Bug report

Bug summary

The function typhon.plots.center_colorbar uses set_clim, which is deprecated since Matplotlib 3.1 and will be removed in 3.3

Code for reproduction

The following code triggers the deprecation warning.

import numpy as np
import matplotilb.pyplot as plt
import typhon as ty


fig, ax = plt.subplots()
sm = ax.pcolormesh(np.random.randn(20, 20) + 1, cmap='seismic')
cb = fig.colorbar(sm)
ty.plots.center_colorbar(cb)

Version information

  • Operating System: //
  • Typhon Version: master
  • Python Version: 3.7
@lkluft lkluft self-assigned this Aug 22, 2019
@lkluft
Copy link
Member Author

lkluft commented Aug 22, 2019

Internally, the deprecated set_clim method of the colorbar is used. There are two possible solutions:

  1. Fix the function by using cb.mappable.set_clim instead
  2. Remove the function and create an own normalization similar to (DivergingNorm)

lkluft added a commit to lkluft/typhon that referenced this issue Mar 16, 2020
The function `set_colorbar_limits` allows the user to set the limits of
the colorbar without affecting the limits of the normalization.

This commit also fixes atmtools#314 (`center_colorbar`).
lkluft added a commit to lkluft/typhon that referenced this issue Mar 16, 2020
The function `set_colorbar_limits` allows the user to set the limits of
the colorbar without affecting the limits of the normalization.

This commit also fixes atmtools#314 (`center_colorbar`).
simonpf pushed a commit to simonpf/typhon that referenced this issue Sep 28, 2020
The function `set_colorbar_limits` allows the user to set the limits of
the colorbar without affecting the limits of the normalization.

This commit also fixes atmtools#314 (`center_colorbar`).
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 a pull request may close this issue.

1 participant