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

Method _scale_norm

lib/matplotlib/colorizer.py:65–85  ·  view source on GitHub ↗

Helper for initial scaling. Used by public functions that create a ScalarMappable and support parameters *vmin*, *vmax* and *norm*. This makes sure that a *norm* will take precedence over *vmin*, *vmax*. Note that this method does not set the norm.

(self, norm, vmin, vmax, A)

Source from the content-addressed store, hash-verified

63 self.colorbar = None
64
65 def _scale_norm(self, norm, vmin, vmax, A):
66 """
67 Helper for initial scaling.
68
69 Used by public functions that create a ScalarMappable and support
70 parameters *vmin*, *vmax* and *norm*. This makes sure that a *norm*
71 will take precedence over *vmin*, *vmax*.
72
73 Note that this method does not set the norm.
74 """
75 if vmin is not None or vmax is not None:
76 self.set_clim(vmin, vmax)
77 if isinstance(norm, colors.Normalize):
78 raise ValueError(
79 "Passing a Normalize instance simultaneously with "
80 "vmin/vmax is not supported. Please pass vmin/vmax "
81 "as arguments to the norm object when creating it")
82
83 # always resolve the autoscaling so we have concrete limits
84 # rather than deferring to draw time.
85 self.autoscale_None(A)
86
87 @property
88 def norm(self):

Callers 8

_scale_normMethod · 0.45
scatterMethod · 0.45
hexbinMethod · 0.45
imshowMethod · 0.45
pcolorMethod · 0.45
pcolormeshMethod · 0.45
pcolorfastMethod · 0.45
tripcolorFunction · 0.45

Calls 2

set_climMethod · 0.95
autoscale_NoneMethod · 0.95

Tested by

no test coverage detected