2
2
unicode_literals )
3
3
4
4
import six
5
- from six .moves import xrange , zip
5
+ from six .moves import zip
6
6
7
7
import unittest
8
8
@@ -49,7 +49,7 @@ def transform_non_affine(self, path):
49
49
50
50
my_trans = AssertingNonAffineTransform ()
51
51
ax = plt .axes ()
52
- plt .plot (list ( xrange ( 10 ) ), transform = my_trans + ax .transData )
52
+ plt .plot (np . arange ( 10 ), transform = my_trans + ax .transData )
53
53
plt .draw ()
54
54
# enable the transform to raise an exception if it's non-affine transform
55
55
# method is triggered again.
@@ -68,7 +68,7 @@ def _as_mpl_transform(self, axes):
68
68
return mtrans .Affine2D ().scale (self ._scale_factor ) + axes .transData
69
69
70
70
ax = plt .axes ()
71
- line , = plt .plot (list ( xrange ( 10 ) ), transform = ScaledBy (10 ))
71
+ line , = plt .plot (np . arange ( 10 ), transform = ScaledBy (10 ))
72
72
ax .set_xlim (0 , 100 )
73
73
ax .set_ylim (0 , 100 )
74
74
# assert that the top transform of the line is the scale transform.
@@ -415,15 +415,15 @@ def test_line_extent_compound_coords2(self):
415
415
def test_line_extents_affine (self ):
416
416
ax = plt .axes ()
417
417
offset = mtrans .Affine2D ().translate (10 , 10 )
418
- plt .plot (list ( xrange ( 10 ) ), transform = offset + ax .transData )
418
+ plt .plot (np . arange ( 10 ), transform = offset + ax .transData )
419
419
expected_data_lim = np .array ([[0. , 0. ], [9. , 9. ]]) + 10
420
420
assert_array_almost_equal (ax .dataLim .get_points (), expected_data_lim )
421
421
422
422
def test_line_extents_non_affine (self ):
423
423
ax = plt .axes ()
424
424
offset = mtrans .Affine2D ().translate (10 , 10 )
425
425
na_offset = NonAffineForTest (mtrans .Affine2D ().translate (10 , 10 ))
426
- plt .plot (list ( xrange ( 10 ) ), transform = offset + na_offset + ax .transData )
426
+ plt .plot (np . arange ( 10 ), transform = offset + na_offset + ax .transData )
427
427
expected_data_lim = np .array ([[0. , 0. ], [9. , 9. ]]) + 20
428
428
assert_array_almost_equal (ax .dataLim .get_points (), expected_data_lim )
429
429
@@ -452,7 +452,7 @@ def test_line_extents_for_non_affine_transData(self):
452
452
# add 10 to the radius of the data
453
453
offset = mtrans .Affine2D ().translate (0 , 10 )
454
454
455
- plt .plot (list ( xrange ( 10 ) ), transform = offset + ax .transData )
455
+ plt .plot (np . arange ( 10 ), transform = offset + ax .transData )
456
456
# the data lim of a polar plot is stored in coordinates
457
457
# before a transData transformation, hence the data limits
458
458
# are not what is being shown on the actual plot.
0 commit comments