X Tutup
Skip to content

clim doesn't update after draw #6352

@kingjr

Description

@kingjr

I am running under 1.5.1 and am having trouble getting the color limit of a figure when only one bound is given. I think this is a bug, and not and intended feature (it used to work in the past):

# no bound given
im = plt.matshow([[1, 2,], [3, 4]])
print(im.get_clim())  # (1, 4)

# only give one bound
im = plt.matshow([[1, 2,], [3, 4]], vmin=0)
print(im.get_clim())  # (1, None)

# draw should update the clim but doesn't
plt.draw()
print(im.get_clim())  # (1, None), expected (1, 4)

# show() updates clim
plt.show()
print(im.get_clim())  # (1, 4)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup