@@ -4044,7 +4044,8 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
4044
4044
4045
4045
if colors is None :
4046
4046
if norm is not None and not isinstance (norm , mcolors .Normalize ):
4047
- msg = "'norm' must be an instance of 'mcolors.Normalize'"
4047
+ msg = ("'norm' must be an instance of 'mcolors.Normalize' or "
4048
+ "'mcolors.BivariateNorm'" )
4048
4049
raise ValueError (msg )
4049
4050
collection .set_array (np .asarray (c ))
4050
4051
collection .set_cmap (cmap )
@@ -4403,7 +4404,8 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
4403
4404
accum = bins .searchsorted (accum )
4404
4405
4405
4406
if norm is not None and not isinstance (norm , mcolors .Normalize ):
4406
- msg = "'norm' must be an instance of 'mcolors.Normalize'"
4407
+ msg = ("'norm' must be an instance of 'mcolors.Normalize' or "
4408
+ "'mcolors.BivariateNorm'" )
4407
4409
raise ValueError (msg )
4408
4410
collection .set_array (accum )
4409
4411
collection .set_cmap (cmap )
@@ -5141,8 +5143,8 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
5141
5143
self .cla ()
5142
5144
5143
5145
if norm is not None and not isinstance (norm , mcolors .Norms ):
5144
- msg = "'norm' must be an instance of 'mcolors.Normalize' " \
5145
- "or 'mcolors.BivariateNorm'"
5146
+ msg = ( "'norm' must be an instance of 'mcolors.Normalize' or "
5147
+ " 'mcolors.BivariateNorm'")
5146
5148
raise ValueError (msg )
5147
5149
5148
5150
if aspect is None :
@@ -5193,9 +5195,9 @@ def _pcolorargs(funcname, *args, **kw):
5193
5195
5194
5196
if len (args ) == 1 :
5195
5197
C = np .asanyarray (args [0 ])
5196
- isBivari = (isinstance (norm , mcolors .BivariateNorm )
5197
- or isinstance (cmap , mcolors .BivariateColormap ))
5198
- if (C .ndim == 3 and isBivari ):
5198
+ is_bivari = (isinstance (norm , mcolors .BivariateNorm ) or
5199
+ isinstance (cmap , mcolors .BivariateColormap ))
5200
+ if (C .ndim == 3 and is_bivari ):
5199
5201
if cmap is None :
5200
5202
cmap = mcolors .BivariateColormap ()
5201
5203
if norm is None :
@@ -5213,9 +5215,9 @@ def _pcolorargs(funcname, *args, **kw):
5213
5215
5214
5216
if len (args ) == 3 :
5215
5217
X , Y , C = [np .asanyarray (a ) for a in args ]
5216
- isBivari = (isinstance (norm , mcolors .BivariateNorm )
5217
- or isinstance (cmap , mcolors .BivariateColormap ))
5218
- if (C .ndim == 3 and isBivari ):
5218
+ is_bivari = (isinstance (norm , mcolors .BivariateNorm ) or
5219
+ isinstance (cmap , mcolors .BivariateColormap ))
5220
+ if (C .ndim == 3 and is_bivari ):
5219
5221
if cmap is None :
5220
5222
cmap = mcolors .BivariateColormap ()
5221
5223
if norm is None :
@@ -5486,8 +5488,8 @@ def pcolor(self, *args, **kwargs):
5486
5488
collection .set_array (C )
5487
5489
5488
5490
if norm is not None and not isinstance (norm , mcolors .Norms ):
5489
- msg = "'norm' must be an instance of 'mcolors.Normalize' " \
5490
- "or 'mcolors.BivariateNorm'"
5491
+ msg = ( "'norm' must be an instance of 'mcolors.Normalize' or "
5492
+ " 'mcolors.BivariateNorm'")
5491
5493
raise ValueError (msg )
5492
5494
5493
5495
collection .set_cmap (cmap )
@@ -5642,7 +5644,8 @@ def pcolormesh(self, *args, **kwargs):
5642
5644
collection .set_alpha (alpha )
5643
5645
collection .set_array (C )
5644
5646
if norm is not None and not isinstance (norm , mcolors .Norms ):
5645
- msg = "'norm' must be an instance of 'mcolors.Normalize'"
5647
+ msg = ("'norm' must be an instance of 'mcolors.Normalize' or "
5648
+ "'mcolors.BivariateNorm'" )
5646
5649
raise ValueError (msg )
5647
5650
collection .set_cmap (cmap )
5648
5651
collection .set_norm (norm )
@@ -5767,15 +5770,15 @@ def pcolorfast(self, *args, **kwargs):
5767
5770
vmax = kwargs .pop ('vmax' , None )
5768
5771
5769
5772
if norm is not None and not isinstance (norm , mcolors .Norms ):
5770
- msg = "'norm' must be an instance of 'mcolors.Normalize' " \
5771
- "or 'mcolors.BivariateNorm'"
5773
+ msg = ( "'norm' must be an instance of 'mcolors.Normalize' or "
5774
+ " 'mcolors.BivariateNorm'")
5772
5775
raise ValueError (msg )
5773
5776
5774
5777
C = np .asarray (args [- 1 ])
5775
5778
5776
- isBivari = (isinstance (norm , mcolors .BivariateNorm )
5777
- or isinstance (cmap , mcolors .BivariateColormap ))
5778
- if (C .ndim == 3 and isBivari ):
5779
+ is_bivari = (isinstance (norm , mcolors .BivariateNorm ) or
5780
+ isinstance (cmap , mcolors .BivariateColormap ))
5781
+ if (C .ndim == 3 and is_bivari ):
5779
5782
nr , nc = C .shape [1 :]
5780
5783
else :
5781
5784
nr , nc = C .shape
0 commit comments