@@ -859,7 +859,7 @@ class Normalize(object):
859
859
the ``[0.0, 1.0]`` interval.
860
860
861
861
"""
862
- def __init__ (self , vmin = None , vmax = None , clip = False ):
862
+ def __init__ (self , vmin = None , vmax = None , clip = False , * , data = None ):
863
863
"""
864
864
If *vmin* or *vmax* is not given, they are initialized from the
865
865
minimum and maximum value respectively of the first input
@@ -876,10 +876,16 @@ def __init__(self, vmin=None, vmax=None, clip=False):
876
876
the over, under, and masked colors in the colormap, so it is
877
877
likely to lead to surprises; therefore the default is
878
878
*clip* = *False*.
879
+
880
+ You can pass an array-like object to *data*, e.g. a list of
881
+ numpy arrays. If *vmin* or *vmax* are *None*, the respective min/max
882
+ of the array is taken as *vmin* / *vmax*.
879
883
"""
880
884
self .vmin = _sanitize_extrema (vmin )
881
885
self .vmax = _sanitize_extrema (vmax )
882
886
self .clip = clip
887
+ if data is not None :
888
+ self .autoscale_None (data )
883
889
884
890
@staticmethod
885
891
def process_value (value ):
@@ -1061,8 +1067,8 @@ class SymLogNorm(Normalize):
1061
1067
*linthresh* allows the user to specify the size of this range
1062
1068
(-*linthresh*, *linthresh*).
1063
1069
"""
1064
- def __init__ (self , linthresh , linscale = 1.0 ,
1065
- vmin = None , vmax = None , clip = False ):
1070
+ def __init__ (self , linthresh , linscale = 1.0 ,
1071
+ vmin = None , vmax = None , clip = False , * , data = None ):
1066
1072
"""
1067
1073
*linthresh*:
1068
1074
The range within which the plot is linear (to
@@ -1076,11 +1082,15 @@ def __init__(self, linthresh, linscale=1.0,
1076
1082
default), the space used for the positive and negative
1077
1083
halves of the linear range will be equal to one decade in
1078
1084
the logarithmic range. Defaults to 1.
1085
+
1086
+ You can pass an array-like object to *data*, e.g. a list of
1087
+ numpy arrays. If *vmin* or *vmax* are *None*, the respective min/max
1088
+ of the array is taken as *vmin* / *vmax*.
1079
1089
"""
1080
- Normalize .__init__ (self , vmin , vmax , clip )
1090
+ Normalize .__init__ (self , vmin , vmax , clip , data = data )
1081
1091
self .linthresh = float (linthresh )
1082
1092
self ._linscale_adj = (linscale / (1.0 - np .e ** - 1 ))
1083
- if vmin is not None and vmax is not None :
1093
+ if self . vmin is not None and self . vmax is not None :
1084
1094
self ._transform_vmin_vmax ()
1085
1095
1086
1096
def __call__ (self , value , clip = None ):
@@ -1173,8 +1183,8 @@ class PowerNorm(Normalize):
1173
1183
Normalize a given value to the ``[0, 1]`` interval with a power-law
1174
1184
scaling. This will clip any negative data points to 0.
1175
1185
"""
1176
- def __init__ (self , gamma , vmin = None , vmax = None , clip = False ):
1177
- Normalize .__init__ (self , vmin , vmax , clip )
1186
+ def __init__ (self , gamma , vmin = None , vmax = None , clip = False , * , data = None ):
1187
+ Normalize .__init__ (self , vmin , vmax , clip , data = data )
1178
1188
self .gamma = gamma
1179
1189
1180
1190
def __call__ (self , value , clip = None ):
0 commit comments