@@ -78,7 +78,7 @@ def _scale_norm(self, norm, vmin, vmax, A):
78
78
raise ValueError (
79
79
"Passing a Normalize instance simultaneously with "
80
80
"vmin/vmax is not supported. Please pass vmin/vmax "
81
- "directly to the norm when creating it. " )
81
+ "directly to the norm when creating it" )
82
82
83
83
# always resolve the autoscaling so we have concrete limits
84
84
# rather than deferring to draw time.
@@ -174,7 +174,7 @@ def _pass_image_data(x, alpha=None, bytes=False, norm=True):
174
174
175
175
if norm and (xx .max () > 1 or xx .min () < 0 ):
176
176
raise ValueError ("Floating point image RGB values "
177
- "must be in the 0..1 range. " )
177
+ "must be in the 0..1 range" )
178
178
if bytes :
179
179
xx = (xx * 255 ).astype (np .uint8 )
180
180
elif xx .dtype == np .uint8 :
@@ -226,7 +226,7 @@ def _set_cmap(self, cmap):
226
226
if self .norm .n_output != cmap_obj .n_variates :
227
227
raise ValueError (f"The colormap { cmap } does not support "
228
228
f"{ self .norm .n_output } variates as required by "
229
- f"the { type (self .norm )} on this Colorizer. " )
229
+ f"the { type (self .norm )} on this Colorizer" )
230
230
self ._cmap = cmap_obj
231
231
if not in_init :
232
232
self .changed () # Things are not set up properly yet.
@@ -788,7 +788,7 @@ def _ensure_norm(norm, n_variates=1):
788
788
return norm
789
789
raise ValueError (
790
790
"Invalid norm for multivariate colormap with "
791
- f"{ n_variates } inputs. "
791
+ f"{ n_variates } inputs"
792
792
)
793
793
794
794
@@ -840,15 +840,12 @@ def _ensure_cmap(cmap, accept_multivariate=False):
840
840
841
841
# this error message is a variant of _api.check_in_list but gives
842
842
# additional hints as to how to access multivariate colormaps
843
-
844
- msg = f"{ cmap !r} is not a valid value for cmap"
845
- msg += "; supported values for scalar colormaps are "
846
- msg += f"{ ', ' .join (map (repr , sorted (mpl .colormaps )))} \n "
847
- msg += "See matplotlib.bivar_colormaps() and"
848
- msg += " matplotlib.multivar_colormaps() for"
849
- msg += " bivariate and multivariate colormaps."
850
-
851
- raise ValueError (msg )
843
+ raise ValueError (f"{ cmap !r} is not a valid value for cmap"
844
+ "; supported values for scalar colormaps are "
845
+ f"{ ', ' .join (map (repr , sorted (mpl .colormaps )))} \n "
846
+ "See `matplotlib.bivar_colormaps()` and"
847
+ " `matplotlib.multivar_colormaps()` for"
848
+ " bivariate and multivariate colormaps" )
852
849
853
850
if isinstance (cmap , colors .Colormap ):
854
851
return cmap
@@ -870,11 +867,13 @@ def _ensure_multivariate_data(data, n_input):
870
867
If n_input is 1 and data is not of type np.ndarray (i.e. PIL.Image),
871
868
the data is returned unchanged.
872
869
If data is None, the function returns None
870
+
873
871
Parameters
874
872
----------
875
873
n_input : int
876
874
- number of variates in the data
877
875
data : np.ndarray, PIL.Image or None
876
+
878
877
Returns
879
878
-------
880
879
np.ndarray, PIL.Image or None
@@ -921,10 +920,10 @@ def _ensure_multivariate_data(data, n_input):
921
920
return data
922
921
923
922
elif n_input == 2 :
924
- raise ValueError ("Invalid data entry for mutlivariate data. The data"
923
+ raise ValueError ("Invalid data entry for multivariate data. The data"
925
924
" must contain complex numbers, or have a first dimension 2,"
926
925
" or be of a dtype with 2 fields" )
927
926
else :
928
- raise ValueError ("Invalid data entry for mutlivariate data. The shape"
927
+ raise ValueError ("Invalid data entry for multivariate data. The shape"
929
928
f" of the data must have a first dimension { n_input } "
930
929
f" or be of a dtype with { n_input } fields" )
0 commit comments