FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

colorbar resizes in animation · Issue #12550 · matplotlib/matplotlib · GitHub

Repository navigation

colorbar resizes in animation #12550

Closed
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()

Actual outcome

Expected outcome

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.

Activity

  1. added
    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
    on Oct 17, 2018
  2. ImportanceOfBeingErnest commented on Oct 17, 2018

    Member

    This bug came in in ENH: adjustable colorbar ticks #9903.

  3. sakra1 commented on Oct 17, 2018

    Author

    Apologies for my lack of experience with Python, and bug reporting, but I am confused about the #9903 issue. Unfortunately I do not fully grasp that piece of Python code, but also that issue was reported in December 2017 with a Matplotlib version earlier than 2.2.3, which does not reveal the issue I raised above. Are you saying my animation issue is a new but comparable issue that is introduced in Matplotlib 3.0.0?

  4. ImportanceOfBeingErnest commented on Oct 17, 2018

    Member

    @sakra1 Your bug report is fine, thanks for that. To explain a bit on the structure here:

    The bug appears first in the development version after #9903 has been merged on 22 March. (This can be found out via git bisect) This commit has been tagged for the 3.0 branch, such that it is not part of the (later) 2.2.3 release. The first release with this bug in it is hence the 3.0.0rc1.

  5. self-assigned this
    on Oct 17, 2018
  6. jklymak commented on Oct 17, 2018

    Member

    Yes, sorry this broke. I believe it is fixed in #12159 and on master, and will be part of 3.0.1 release in early Nov.

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

Metadata

Metadata

Assignees

Labels

Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL