@@ -970,7 +970,7 @@ class PiecewiseLinearNorm(Normalize):
970
970
971
971
Normalizes data into the ``[0.0, 1.0]`` interval.
972
972
"""
973
- def __init__ (self , vmin = None , vcenter = None , vmax = None , clip = False ):
973
+ def __init__ (self , vmin = None , vcenter = None , vmax = None ):
974
974
"""Normalize data with an offset midpoint
975
975
976
976
Useful when mapping data unequally centered around a conceptual
@@ -990,11 +990,6 @@ def __init__(self, vmin=None, vcenter=None, vmax=None, clip=False):
990
990
The data value that defines ``1.0`` in the normalized data.
991
991
Defaults to the the max value of the dataset.
992
992
993
- clip : bool, optional (default is False)
994
- If *clip* is True, values beyond *vmin* and *vmax* will be set
995
- to ``0.0`` or ``1.0``, respectively. Otherwise, values outside
996
- the ``[0.0, 1.0]`` will be returned.
997
-
998
993
Examples
999
994
--------
1000
995
>>> import matplotlib.colors as mcolors
@@ -1008,11 +1003,9 @@ def __init__(self, vmin=None, vcenter=None, vmax=None, clip=False):
1008
1003
self .vmin = vmin
1009
1004
self .vcenter = vcenter
1010
1005
self .vmax = vmax
1011
- self .clip = clip
1012
1006
1013
1007
def __call__ (self , value , clip = None ):
1014
- if clip is None :
1015
- clip = self .clip
1008
+ """Map value to the interval [0, 1]. The clip argument is unused."""
1016
1009
1017
1010
result , is_scalar = self .process_value (value )
1018
1011
@@ -1028,10 +1021,6 @@ def __call__(self, value, clip=None):
1028
1021
vmin = float (vmin )
1029
1022
vcenter = float (vcenter )
1030
1023
vmax = float (vmax )
1031
- if clip :
1032
- mask = ma .getmask (result )
1033
- result = ma .array (np .clip (result .filled (vmax ), vmin , vmax ),
1034
- mask = mask )
1035
1024
1036
1025
x , y = [vmin , vcenter , vmax ], [0 , 0.5 , 1 ]
1037
1026
# returns a scalar if shape == (1,)
0 commit comments