@@ -997,11 +997,11 @@ def __init__(self, fpos=(lambda x: x**.5),
997
997
if vmin is not None and vmax is not None :
998
998
if vmin > vmax :
999
999
raise ValueError ("vmin must be less than vmax" )
1000
- self .fneg = fneg
1001
- self .fpos = fpos
1002
- self .fneginv = fneginv
1003
- self .fposinv = fposinv
1004
- self .center = center
1000
+ self ._fneg = fneg
1001
+ self ._fpos = fpos
1002
+ self ._fneginv = fneginv
1003
+ self ._fposinv = fposinv
1004
+ self ._center = center
1005
1005
Normalize .__init__ (self , vmin , vmax , clip )
1006
1006
1007
1007
def __call__ (self , value , clip = None ):
@@ -1013,8 +1013,8 @@ def __call__(self, value, clip=None):
1013
1013
vmin = self .vmin
1014
1014
vmax = self .vmax
1015
1015
1016
- widthpos = 1 - self .center
1017
- widthneg = self .center
1016
+ widthpos = 1 - self ._center
1017
+ widthneg = self ._center
1018
1018
1019
1019
result [result > vmax ] = vmax
1020
1020
result [result < vmin ] = vmin
@@ -1023,17 +1023,17 @@ def __call__(self, value, clip=None):
1023
1023
masknegative = result < 0
1024
1024
if vmax > 0 and vmin < 0 :
1025
1025
result [masknegative ] = - \
1026
- self .fneg (result [masknegative ] / vmin ) * widthneg
1027
- result [maskpositive ] = self .fpos (
1026
+ self ._fneg (result [masknegative ] / vmin ) * widthneg
1027
+ result [maskpositive ] = self ._fpos (
1028
1028
result [maskpositive ] / vmax ) * widthpos
1029
1029
1030
1030
elif vmax > 0 and vmin >= 0 :
1031
- result [maskpositive ] = self .fpos (
1031
+ result [maskpositive ] = self ._fpos (
1032
1032
(result [maskpositive ] - vmin ) / (vmax - vmin )) * widthpos
1033
1033
1034
1034
elif vmax <= 0 and vmin < 0 :
1035
1035
result [masknegative ] = - \
1036
- self .fneg ((result [maskpositive ] - vmax ) /
1036
+ self ._fneg ((result [maskpositive ] - vmax ) /
1037
1037
(vmin - vmax )) * widthneg
1038
1038
1039
1039
result = result + widthneg
@@ -1045,8 +1045,8 @@ def inverse(self, value):
1045
1045
1046
1046
vmin = self .vmin
1047
1047
vmax = self .vmax
1048
- widthpos = 1 - self .center
1049
- widthneg = self .center
1048
+ widthpos = 1 - self ._center
1049
+ widthneg = self ._center
1050
1050
1051
1051
value = value - widthneg
1052
1052
@@ -1057,35 +1057,35 @@ def inverse(self, value):
1057
1057
1058
1058
if vmax > 0 and vmin < 0 :
1059
1059
value [masknegative ] = \
1060
- self .fneginv (- value [masknegative ] / widthneg ) * vmin
1061
- value [maskpositive ] = self .fposinv (
1060
+ self ._fneginv (- value [masknegative ] / widthneg ) * vmin
1061
+ value [maskpositive ] = self ._fposinv (
1062
1062
value [maskpositive ] / widthpos ) * vmax
1063
1063
1064
1064
elif vmax > 0 and vmin >= 0 :
1065
- value [maskpositive ] = self .fposinv (
1065
+ value [maskpositive ] = self ._fposinv (
1066
1066
value [maskpositive ] / widthpos ) * (vmax - vmin ) + vmin
1067
- value [masknegative ] = - self .fposinv (
1067
+ value [masknegative ] = - self ._fposinv (
1068
1068
value [masknegative ] / widthneg ) * (vmax - vmin ) + vmin
1069
1069
elif vmax <= 0 and vmin < 0 :
1070
- value [masknegative ] = self .fneginv (
1070
+ value [masknegative ] = self ._fneginv (
1071
1071
- value [masknegative ] / widthneg ) * (vmin - vmax ) + vmax
1072
1072
1073
1073
else :
1074
1074
1075
1075
if vmax > 0 and vmin < 0 :
1076
1076
if value < 0 :
1077
- value = self .fneginv (- value / widthneg ) * vmin
1077
+ value = self ._fneginv (- value / widthneg ) * vmin
1078
1078
else :
1079
- value = self .fposinv (value / widthpos ) * vmax
1079
+ value = self ._fposinv (value / widthpos ) * vmax
1080
1080
1081
1081
elif vmax > 0 and vmin >= 0 :
1082
1082
if value > 0 :
1083
- value = self .fposinv (value / widthpos ) * \
1083
+ value = self ._fposinv (value / widthpos ) * \
1084
1084
(vmax - vmin ) + vmin
1085
1085
1086
1086
elif vmax <= 0 and vmin < 0 :
1087
1087
if value < 0 :
1088
- value = self .fneginv (- value / widthneg ) * \
1088
+ value = self ._fneginv (- value / widthneg ) * \
1089
1089
(vmin - vmax ) + vmax
1090
1090
return value
1091
1091
@@ -1141,8 +1141,8 @@ def __init__(self, fpos=(lambda x: x**0.5),
1141
1141
if vmin is not None and vmax is not None :
1142
1142
if vmin > vmax :
1143
1143
raise ValueError ("vmin must be less than vmax" )
1144
- self .fpos = fpos
1145
- self .fposinv = fposinv
1144
+ self ._fpos = fpos
1145
+ self ._fposinv = fposinv
1146
1146
Normalize .__init__ (self , vmin , vmax , clip )
1147
1147
1148
1148
def __call__ (self , value , clip = None ):
@@ -1157,7 +1157,7 @@ def __call__(self, value, clip=None):
1157
1157
result [result > vmax ] = vmax
1158
1158
result [result < vmin ] = vmin
1159
1159
1160
- result = self .fpos ((result - vmin ) / (vmax - vmin ))
1160
+ result = self ._fpos ((result - vmin ) / (vmax - vmin ))
1161
1161
1162
1162
self .autoscale_None (result )
1163
1163
return result
@@ -1168,9 +1168,9 @@ def inverse(self, value):
1168
1168
vmax = self .vmax
1169
1169
1170
1170
if cbook .iterable (value ):
1171
- value = self .fposinv (value ) * (vmax - vmin ) + vmin
1171
+ value = self ._fposinv (value ) * (vmax - vmin ) + vmin
1172
1172
else :
1173
- value = self .fposinv (value ) * (vmax - vmin ) + vmin
1173
+ value = self ._fposinv (value ) * (vmax - vmin ) + vmin
1174
1174
return value
1175
1175
1176
1176
def ticks (self , N = 11 ):
@@ -1211,8 +1211,8 @@ def __init__(self, fneg=(lambda x: x**0.5), fneginv=(lambda x: x**2),
1211
1211
if vmin is not None and vmax is not None :
1212
1212
if vmin > vmax :
1213
1213
raise ValueError ("vmin must be less than vmax" )
1214
- self .fneg = fneg
1215
- self .fneginv = fneginv
1214
+ self ._fneg = fneg
1215
+ self ._fneginv = fneginv
1216
1216
Normalize .__init__ (self , vmin , vmax , clip )
1217
1217
1218
1218
def __call__ (self , value , clip = None ):
@@ -1227,7 +1227,7 @@ def __call__(self, value, clip=None):
1227
1227
result [result > vmax ] = vmax
1228
1228
result [result < vmin ] = vmin
1229
1229
1230
- result = - self .fneg ((result - vmax ) / (vmin - vmax ))
1230
+ result = - self ._fneg ((result - vmax ) / (vmin - vmax ))
1231
1231
result = result + 1
1232
1232
1233
1233
self .autoscale_None (result )
@@ -1241,9 +1241,9 @@ def inverse(self, value):
1241
1241
value = value - 1
1242
1242
1243
1243
if cbook .iterable (value ):
1244
- value = self .fneginv (- value ) * (vmin - vmax ) + vmax
1244
+ value = self ._fneginv (- value ) * (vmin - vmax ) + vmax
1245
1245
else :
1246
- value = self .fneginv (value ) * (vmin - vmax ) + vmax
1246
+ value = self ._fneginv (value ) * (vmin - vmax ) + vmax
1247
1247
1248
1248
return value
1249
1249
@@ -1324,64 +1324,6 @@ def __init__(self, orderneg=2, vmin=None, vmax=None, clip=False):
1324
1324
vmin = vmin , vmax = vmax , clip = clip )
1325
1325
1326
1326
1327
- class SymRootNorm (ArbitraryNorm ):
1328
- """
1329
- Root normalization for positive and negative data.
1330
- """
1331
- def __init__ (self , orderpos = 2 , orderneg = None ,
1332
- vmin = None , vmax = None , clip = False , center = 0.5 ):
1333
- """
1334
- *orderpos*:
1335
- Degree of the root used to normalize the data for the positive
1336
- direction.
1337
- *orderneg*:
1338
- Degree of the root used to normalize the data for the negative
1339
- direction. By default equal to *orderpos*.
1340
- """
1341
-
1342
- if orderneg is None :
1343
- orderneg = orderpos
1344
- ArbitraryNorm .__init__ (self ,
1345
- fneg = (lambda x : x ** (1. / orderneg )),
1346
- fneginv = (lambda x : x ** (orderneg )),
1347
- fpos = (lambda x : x ** (1. / orderpos )),
1348
- fposinv = (lambda x : x ** (orderpos )),
1349
- center = center ,
1350
- vmin = vmin , vmax = vmax , clip = clip )
1351
-
1352
-
1353
- class PositiveRootNorm (PositiveArbitraryNorm ):
1354
- """
1355
- Root normalization for positive data.
1356
- """
1357
- def __init__ (self , orderpos = 2 , vmin = None , vmax = None , clip = False ):
1358
- """
1359
- *orderpos*:
1360
- Degree of the root used to normalize the data for the positive
1361
- direction.
1362
- """
1363
- PositiveArbitraryNorm .__init__ (self ,
1364
- fpos = (lambda x : x ** (1. / orderpos )),
1365
- fposinv = (lambda x : x ** (orderpos )),
1366
- vmin = vmin , vmax = vmax , clip = clip )
1367
-
1368
-
1369
- class NegativeRootNorm (NegativeArbitraryNorm ):
1370
- """
1371
- Root normalization for negative data.
1372
- """
1373
- def __init__ (self , orderneg = 2 , vmin = None , vmax = None , clip = False ):
1374
- """
1375
- *orderneg*:
1376
- Degree of the root used to normalize the data for the negative
1377
- direction.
1378
- """
1379
- NegativeArbitraryNorm .__init__ (self ,
1380
- fneg = (lambda x : x ** (1. / orderneg )),
1381
- fneginv = (lambda x : x ** (orderneg )),
1382
- vmin = vmin , vmax = vmax , clip = clip )
1383
-
1384
-
1385
1327
class LogNorm (Normalize ):
1386
1328
"""
1387
1329
Normalize a given value to the 0-1 range on a log scale
0 commit comments