@@ -288,7 +288,7 @@ def _plot_args(self, tup, kwargs):
288
288
linestyle , marker , color = _process_plot_format (tup [- 1 ])
289
289
tup = tup [:- 1 ]
290
290
elif len (tup ) == 3 :
291
- raise ValueError , 'third arg must be a format string'
291
+ raise ValueError ( 'third arg must be a format string' )
292
292
else :
293
293
linestyle , marker , color = None , None , None
294
294
kw = {}
@@ -1489,7 +1489,7 @@ def _update_line_limits(self, line):
1489
1489
return
1490
1490
1491
1491
line_trans = line .get_transform ()
1492
-
1492
+
1493
1493
if line_trans == self .transData :
1494
1494
data_path = path
1495
1495
@@ -1508,8 +1508,8 @@ def _update_line_limits(self, line):
1508
1508
else :
1509
1509
data_path = trans_to_data .transform_path (path )
1510
1510
else :
1511
- # for backwards compatibility we update the dataLim with the
1512
- # coordinate range of the given path, even though the coordinate
1511
+ # for backwards compatibility we update the dataLim with the
1512
+ # coordinate range of the given path, even though the coordinate
1513
1513
# systems are completely different. This may occur in situations
1514
1514
# such as when ax.transAxes is passed through for absolute
1515
1515
# positioning.
@@ -1519,7 +1519,7 @@ def _update_line_limits(self, line):
1519
1519
updatex , updatey = line_trans .contains_branch_seperately (
1520
1520
self .transData
1521
1521
)
1522
- self .dataLim .update_from_path (data_path ,
1522
+ self .dataLim .update_from_path (data_path ,
1523
1523
self .ignore_existing_data_limits ,
1524
1524
updatex = updatex ,
1525
1525
updatey = updatey )
@@ -2216,11 +2216,11 @@ def ticklabel_format(self, **kwargs):
2216
2216
cb = False
2217
2217
else :
2218
2218
cb = True
2219
- raise NotImplementedError , "comma style remains to be added"
2219
+ raise NotImplementedError ( "comma style remains to be added" )
2220
2220
elif style == '' :
2221
2221
sb = None
2222
2222
else :
2223
- raise ValueError , "%s is not a valid style value"
2223
+ raise ValueError ( "%s is not a valid style value" )
2224
2224
try :
2225
2225
if sb is not None :
2226
2226
if axis == 'both' or axis == 'x' :
@@ -3723,9 +3723,9 @@ def hlines(self, y, xmin, xmax, colors='k', linestyles='solid',
3723
3723
xmax = np .resize ( xmax , y .shape )
3724
3724
3725
3725
if len (xmin )!= len (y ):
3726
- raise ValueError , 'xmin and y are unequal sized sequences'
3726
+ raise ValueError ( 'xmin and y are unequal sized sequences' )
3727
3727
if len (xmax )!= len (y ):
3728
- raise ValueError , 'xmax and y are unequal sized sequences'
3728
+ raise ValueError ( 'xmax and y are unequal sized sequences' )
3729
3729
3730
3730
verts = [ ((thisxmin , thisy ), (thisxmax , thisy ))
3731
3731
for thisxmin , thisxmax , thisy in zip (xmin , xmax , y )]
@@ -3802,9 +3802,9 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid',
3802
3802
ymax = np .resize ( ymax , x .shape )
3803
3803
3804
3804
if len (ymin )!= len (x ):
3805
- raise ValueError , 'ymin and x are unequal sized sequences'
3805
+ raise ValueError ( 'ymin and x are unequal sized sequences' )
3806
3806
if len (ymax )!= len (x ):
3807
- raise ValueError , 'ymax and x are unequal sized sequences'
3807
+ raise ValueError ( 'ymax and x are unequal sized sequences' )
3808
3808
3809
3809
Y = np .array ([ymin , ymax ]).T
3810
3810
@@ -4785,7 +4785,7 @@ def make_iterable(x):
4785
4785
if len (height ) == 1 :
4786
4786
height *= nbars
4787
4787
else :
4788
- raise ValueError , 'invalid orientation: %s' % orientation
4788
+ raise ValueError ( 'invalid orientation: %s' % orientation )
4789
4789
4790
4790
if len (linewidth ) < nbars :
4791
4791
linewidth *= nbars
@@ -4843,7 +4843,7 @@ def make_iterable(x):
4843
4843
bottom = [bottom [i ] - height [i ]/ 2. for i in xrange (len (bottom ))]
4844
4844
4845
4845
else :
4846
- raise ValueError , 'invalid alignment: %s' % align
4846
+ raise ValueError ( 'invalid alignment: %s' % align )
4847
4847
4848
4848
args = zip (left , bottom , width , height , color , edgecolor , linewidth )
4849
4849
for l , b , w , h , c , e , lw in args :
@@ -5718,7 +5718,7 @@ def computeConfInterval(data, med, iq, bootstrap):
5718
5718
else :
5719
5719
x = [x [:,i ] for i in xrange (nc )]
5720
5720
else :
5721
- raise ValueError , "input x can have no more than 2 dimensions"
5721
+ raise ValueError ( "input x can have no more than 2 dimensions" )
5722
5722
if not hasattr (x [0 ], '__len__' ):
5723
5723
x = [x ]
5724
5724
col = len (x )
@@ -7086,10 +7086,10 @@ def _pcolorargs(self, funcname, *args):
7086
7086
7087
7087
Nx = X .shape [- 1 ]
7088
7088
Ny = Y .shape [0 ]
7089
- if len (X .shape ) <> 2 or X .shape [0 ] == 1 :
7089
+ if len (X .shape ) != 2 or X .shape [0 ] == 1 :
7090
7090
x = X .reshape (1 ,Nx )
7091
7091
X = x .repeat (Ny , axis = 0 )
7092
- if len (Y .shape ) <> 2 or Y .shape [1 ] == 1 :
7092
+ if len (Y .shape ) != 2 or Y .shape [1 ] == 1 :
7093
7093
y = Y .reshape (Ny , 1 )
7094
7094
Y = y .repeat (Nx , axis = 1 )
7095
7095
if X .shape != Y .shape :
@@ -8834,9 +8834,9 @@ def __init__(self, fig, *args, **kwargs):
8834
8834
8835
8835
def __reduce__ (self ):
8836
8836
# get the first axes class which does not inherit from a subplotbase
8837
- axes_class = filter ( lambda klass : ( issubclass (klass , Axes ) and
8838
- not issubclass (klass , SubplotBase )),
8839
- self .__class__ .mro ()) [0 ]
8837
+ not_subplotbase = lambda c : issubclass (c , Axes ) and \
8838
+ not issubclass (c , SubplotBase )
8839
+ axes_class = [ c for c in self .__class__ .mro () if not_subplotbase ( c )] [0 ]
8840
8840
r = [_PicklableSubplotClassConstructor (),
8841
8841
(axes_class ,),
8842
8842
self .__getstate__ ()]
@@ -8925,8 +8925,8 @@ def subplot_class_factory(axes_class=None):
8925
8925
8926
8926
class _PicklableSubplotClassConstructor (object ):
8927
8927
"""
8928
- This stub class exists to return the appropriate subplot
8929
- class when __call__-ed with an axes class. This is purely to
8928
+ This stub class exists to return the appropriate subplot
8929
+ class when __call__-ed with an axes class. This is purely to
8930
8930
allow Pickling of Axes and Subplots.
8931
8931
"""
8932
8932
def __call__ (self , axes_class ):
0 commit comments