Reputation: 2240
When making a plot to start with I can use:
fig, ax = plt.subplots()
h = ax.imshow(X, vmin=mn, vmax=mx)
Once the plot is up, can I change my mind and make vmin
and vmax
something different?
Upvotes: 0
Views: 796
Reputation: 2240
This also does the trick:
h.set_clim([mn, mx])
And to reset to "auto":
h.set_norm(None)
Upvotes: 0
Reputation: 40707
You can change the normalization of the image using set_norm()
and passing a Normalize
object:
norm = matplotlib.colors.Normalize(vmin=0, vmax=1)
h.set_norm(norm)
Upvotes: 2