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)
| 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): |
no test coverage detected