Closed
Description
Bug report
When animating a 2D plot with a colorbar, updating the color limits in each iteration changes the size of the colorbar. This issue did not exist with matplotlib 2.2.3.
import numpy as np
import matplotlib.pyplot as plt
from scipy.ndimage import laplace
def main():
time = np.arange(0, 1, 0.01)
c = np.zeros(shape=(11, 11))
c[5, 5] = 1
fig = plt.figure()
ax = fig.gca()
im = ax.imshow(c)
fig.colorbar(im)
for t in time:
c += laplace(c) / 10
im.set_data(c)
im.set_clim(0, np.max(c))
plt.pause(0.001)
plt.show()
if __name__ == "__main__":
main()
Matplotlib version
- Operating system: windows 7
- Matplotlib version: 3.0.0
- Matplotlib backend (
print(matplotlib.get_backend())
): TkAgg - Python version: 3.7
Python was installed using the latest Anaconda distribution.
Metadata
Metadata
Assignees
Labels
For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.