Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b5801ea

Browse files
alvarosgalvarosg
alvarosg
authored andcommitted
Corrected lambda function syntax that was not compatible with python 3. Change name of argument orderpos by simple order in RootNorm
1 parent 1d22b90 commit b5801ea

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

doc/users/plotting/examples/colormap_normalizations_rootnorm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def makePlot(norm, label):
6060

6161
makePlot(None, 'Regular linear scale')
6262

63-
norm = colors.RootNorm(vmin=0, orderpos=5)
63+
norm = colors.RootNorm(vmin=0, order=5)
6464
makePlot(norm, 'Root norm')
6565

6666
norm = colors.MirrorRootNorm(

lib/matplotlib/colors.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,8 +1211,8 @@ def __init__(self,
12111211
refpoints_cm = np.array([center_cm])
12121212
refpoints_data = np.array([center_data])
12131213

1214-
flist = [lambda (x):(-fneg(-x + 1) + 1), fpos]
1215-
finvlist = [lambda (x):(-fneginv(-x + 1) + 1), fposinv]
1214+
flist = [(lambda x:(-fneg(-x + 1) + 1)), fpos]
1215+
finvlist = [(lambda x:(-fneginv(-x + 1) + 1)), fposinv]
12161216

12171217
super(MirrorArbitraryNorm, self).__init__(flist=flist,
12181218
finvlist=finvlist,
@@ -1293,14 +1293,14 @@ class RootNorm(SingleArbitraryNorm):
12931293
>>> norm=PositiveRootNorm(vmin=0,orderpos=7)
12941294
"""
12951295

1296-
def __init__(self, orderpos=2, vmin=None, vmax=None, clip=False):
1296+
def __init__(self, order=2, vmin=None, vmax=None, clip=False):
12971297
"""
1298-
*orderpos*:
1298+
*order*:
12991299
Degree of the root used to normalize the data for the positive
13001300
direction.
13011301
"""
1302-
super(RootNorm, self).__init__(f=(lambda x: x**(1. / orderpos)),
1303-
finv=(lambda x: x**(orderpos)),
1302+
super(RootNorm, self).__init__(f=(lambda x: x**(1. / order)),
1303+
finv=(lambda x: x**(order)),
13041304
vmin=vmin, vmax=vmax, clip=clip)
13051305

13061306

0 commit comments

Comments
 (0)