MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / set_clim

Method set_clim

lib/matplotlib/colorizer.py:240–275  ·  view source on GitHub ↗

Set the norm limits for image scaling. Parameters ---------- vmin, vmax : float The limits. For scalar data, the limits may also be passed as a tuple (*vmin*, *vmax*) single positional argument. .. ACCEPTS: (vmin

(self, vmin=None, vmax=None)

Source from the content-addressed store, hash-verified

238 self._set_cmap(cmap)
239
240 def set_clim(self, vmin=None, vmax=None):
241 """
242 Set the norm limits for image scaling.
243
244 Parameters
245 ----------
246 vmin, vmax : float
247 The limits.
248
249 For scalar data, the limits may also be passed as a
250 tuple (*vmin*, *vmax*) single positional argument.
251
252 .. ACCEPTS: (vmin: float, vmax: float)
253 """
254 if self.norm.n_components == 1:
255 if vmax is None:
256 try:
257 vmin, vmax = vmin
258 except (TypeError, ValueError):
259 pass
260
261 orig_vmin_vmax = self.norm.vmin, self.norm.vmax
262
263 # Blocked context manager prevents callbacks from being triggered
264 # until both vmin and vmax are updated
265 with self.norm.callbacks.blocked(signal='changed'):
266 # Since the @vmin/vmax.setter invokes colors._sanitize_extrema()
267 # to sanitize the input, the input is not sanitized here
268 if vmin is not None:
269 self.norm.vmin = vmin
270 if vmax is not None:
271 self.norm.vmax = vmax
272
273 # emit a update signal if the limits are changed
274 if orig_vmin_vmax != (self.norm.vmin, self.norm.vmax):
275 self.norm.callbacks.process('changed')
276
277 def get_clim(self):
278 """

Callers 15

imsaveFunction · 0.95
_scale_normMethod · 0.95
vminMethod · 0.95
vmaxMethod · 0.95
plot_surfaceMethod · 0.45
plot_trisurfMethod · 0.45
set_climMethod · 0.45
figimageMethod · 0.45
climFunction · 0.45
apply_callbackFunction · 0.45
on_changedMethod · 0.45

Calls 2

blockedMethod · 0.80
processMethod · 0.80

Tested by 6

test_colorbar_formatFunction · 0.36
test_imshow_flatfieldFunction · 0.36
test_imshow_bignumbersFunction · 0.36