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

Commitbd8e726

Browse files
committed
updates based on feedback from@timhoffm (and@QuLogic )
1 parentb3c4d4d commitbd8e726

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

‎lib/matplotlib/colors.py

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3279,16 +3279,16 @@ def inverse(self, value):
32793279

32803280
classMultiNorm(Normalize):
32813281
"""
3282-
Amixinclass which contains multiple scalar norms
3282+
A class which contains multiple scalar norms
32833283
"""
32843284

32853285
def__init__(self,norms,vmin=None,vmax=None,clip=False):
32863286
"""
32873287
Parameters
32883288
----------
3289-
norms :List of (str, `Normalize` or None)
3289+
norms :list of (str, `Normalize` or None)
32903290
The constituent norms. The list must have a minimum length of 2.
3291-
vmin, vmax : float,None, or list of float or None
3291+
vmin, vmax : float orNone or list of(float or None)
32923292
Limits of the constituent norms.
32933293
If a list, each value is assigned to each of the constituent
32943294
norms. Single values are repeated to form a list of appropriate size.
@@ -3332,14 +3332,17 @@ def __init__(self, norms, vmin=None, vmax=None, clip=False):
33323332

33333333
@property
33343334
defn_variables(self):
3335+
"""Number of norms held by this `MultiNorm`."""
33353336
returnlen(self._norms)
33363337

33373338
@property
33383339
defnorms(self):
3340+
"""The individual norms held by this `MultiNorm`"""
33393341
returnself._norms
33403342

33413343
@property
33423344
defvmin(self):
3345+
"""The lower limit of each constituent norm."""
33433346
returntuple(n.vminforninself._norms)
33443347

33453348
@vmin.setter
@@ -3353,6 +3356,7 @@ def vmin(self, value):
33533356

33543357
@property
33553358
defvmax(self):
3359+
"""The upper limit of each constituent norm."""
33563360
returntuple(n.vmaxforninself._norms)
33573361

33583362
@vmax.setter
@@ -3366,6 +3370,7 @@ def vmax(self, value):
33663370

33673371
@property
33683372
defclip(self):
3373+
"""The clip behaviour of each constituent norm."""
33693374
returntuple(n.clipforninself._norms)
33703375

33713376
@clip.setter
@@ -3392,17 +3397,17 @@ def __call__(self, value, clip=None):
33923397
33933398
Parameters
33943399
----------
3395-
value
3396-
Data to normalize. Must be of length `n_variables` orhave adata type with
3397-
`n_variables` fields.
3400+
value : array-like
3401+
Data to normalize. Must be of length `n_variables` orbe astructured
3402+
array or scalar with`n_variables` fields.
33983403
clip : list of bools or bool, optional
33993404
See the description of the parameter *clip* in Normalize.
34003405
If ``None``, defaults to ``self.clip`` (which defaults to
34013406
``False``).
34023407
34033408
Returns
34043409
-------
3405-
List
3410+
list
34063411
Normalized input values as a list of length `n_variables`
34073412
34083413
Notes
@@ -3426,8 +3431,8 @@ def inverse(self, value):
34263431
Parameters
34273432
----------
34283433
value
3429-
Normalized value. Must be of length `n_variables` orhave adata type with
3430-
`n_variables` fields.
3434+
Normalized value. Must be of length `n_variables` orbe astructured array
3435+
or scalar with`n_variables` fields.
34313436
"""
34323437
value=self._iterable_variates_in_data(value,self.n_variables)
34333438
result= [n.inverse(v)forn,vinzip(self.norms,value)]
@@ -3454,8 +3459,8 @@ def autoscale_None(self, A):
34543459
Parameters
34553460
----------
34563461
A
3457-
Data, must be of length `n_variables` orhave adata type with
3458-
`n_variables` fields.
3462+
Data, must be of length `n_variables` orbe astructured array or scalar
3463+
with`n_variables` fields.
34593464
"""
34603465
withself.callbacks.blocked():
34613466
A=self._iterable_variates_in_data(A,self.n_variables)
@@ -3464,7 +3469,7 @@ def autoscale_None(self, A):
34643469
self._changed()
34653470

34663471
defscaled(self):
3467-
"""Return whether both *vmin* and *vmax* are set on all constituent norms"""
3472+
"""Return whether both *vmin* and *vmax* are set on all constituent norms."""
34683473
returnall([n.scaled()forninself.norms])
34693474

34703475
@staticmethod
@@ -3490,8 +3495,8 @@ def _iterable_variates_in_data(data, n_variables):
34903495
data= [data[descriptor[0]]fordescriptorindata.dtype.descr]
34913496
iflen(data)!=n_variables:
34923497
raiseValueError("The input to this `MultiNorm` must be of shape "
3493-
f"({n_variables}, ...), orhave a data type with "
3494-
f"{n_variables} fields.")
3498+
f"({n_variables}, ...), orbe structured array or scalar "
3499+
f"with{n_variables} fields.")
34953500
returndata
34963501

34973502

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp