Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit41acef7

Browse files
committed
Updates based on feedback from review
1 parenteeb895c commit41acef7

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

‎lib/matplotlib/colorizer.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def _scale_norm(self, norm, vmin, vmax, A):
7878
raiseValueError(
7979
"Passing a Normalize instance simultaneously with "
8080
"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")
8282

8383
# always resolve the autoscaling so we have concrete limits
8484
# rather than deferring to draw time.
@@ -174,7 +174,7 @@ def _pass_image_data(x, alpha=None, bytes=False, norm=True):
174174

175175
ifnormand (xx.max()>1orxx.min()<0):
176176
raiseValueError("Floating point image RGB values "
177-
"must be in the 0..1 range.")
177+
"must be in the 0..1 range")
178178
ifbytes:
179179
xx= (xx*255).astype(np.uint8)
180180
elifxx.dtype==np.uint8:
@@ -226,7 +226,7 @@ def _set_cmap(self, cmap):
226226
ifself.norm.n_output!=cmap_obj.n_variates:
227227
raiseValueError(f"The colormap{cmap} does not support "
228228
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")
230230
self._cmap=cmap_obj
231231
ifnotin_init:
232232
self.changed()# Things are not set up properly yet.
@@ -788,7 +788,7 @@ def _ensure_norm(norm, n_variates=1):
788788
returnnorm
789789
raiseValueError(
790790
"Invalid norm for multivariate colormap with "
791-
f"{n_variates} inputs."
791+
f"{n_variates} inputs"
792792
)
793793

794794

@@ -840,15 +840,12 @@ def _ensure_cmap(cmap, accept_multivariate=False):
840840

841841
# this error message is a variant of _api.check_in_list but gives
842842
# 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-
raiseValueError(msg)
843+
raiseValueError(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")
852849

853850
ifisinstance(cmap,colors.Colormap):
854851
returncmap
@@ -921,10 +918,10 @@ def _ensure_multivariate_data(data, n_input):
921918
returndata
922919

923920
elifn_input==2:
924-
raiseValueError("Invalid data entry formutlivariate data. The data"
921+
raiseValueError("Invalid data entry formultivariate data. The data"
925922
" must contain complex numbers, or have a first dimension 2,"
926923
" or be of a dtype with 2 fields")
927924
else:
928-
raiseValueError("Invalid data entry formutlivariate data. The shape"
925+
raiseValueError("Invalid data entry formultivariate data. The shape"
929926
f" of the data must have a first dimension{n_input}"
930927
f" or be of a dtype with{n_input} fields")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp