11from __future__ import (absolute_import , division , print_function ,
22 unicode_literals )
33
4- from six .moves import xrange
54try :
65 # mock in python 3.3+
76 from unittest import mock
@@ -58,9 +57,9 @@ def test_various_labels():
5857 # tests all sorts of label types
5958 fig = plt .figure ()
6059 ax = fig .add_subplot (121 )
61- ax .plot (list ( xrange ( 4 ) ), 'o' , label = 1 )
60+ ax .plot (np . arage ( 4 ), 'o' , label = 1 )
6261 ax .plot (np .linspace (4 , 4.1 ), 'o' , label = 'D\xe9 velopp\xe9 s' )
63- ax .plot (list ( xrange ( 4 , 1 , - 1 ) ), 'o' , label = '__nolegend__' )
62+ ax .plot (np . arage ( 4 , 1 , - 1 ), 'o' , label = '__nolegend__' )
6463 ax .legend (numpoints = 1 , loc = 0 )
6564
6665
@@ -122,9 +121,9 @@ def test_alpha_rcparam():
122121def test_fancy ():
123122 # using subplot triggers some offsetbox functionality untested elsewhere
124123 plt .subplot (121 )
125- plt .scatter (list ( xrange ( 10 )), list ( xrange ( 10 , 0 , - 1 ) ), label = 'XX\n XX' )
124+ plt .scatter (np . arange ( 10 ), np . arange ( 10 , 0 , - 1 ), label = 'XX\n XX' )
126125 plt .plot ([5 ] * 10 , 'o--' , label = 'XX' )
127- plt .errorbar (list ( xrange ( 10 )), list ( xrange ( 10 ) ), xerr = 0.5 ,
126+ plt .errorbar (np . arange ( 10 ), np . arange ( 10 ), xerr = 0.5 ,
128127 yerr = 0.5 , label = 'XX' )
129128 plt .legend (loc = "center left" , bbox_to_anchor = [1.0 , 0.5 ],
130129 ncol = 2 , shadow = True , title = "My legend" , numpoints = 1 )
@@ -144,14 +143,14 @@ def test_rc():
144143 # using subplot triggers some offsetbox functionality untested elsewhere
145144 plt .figure ()
146145 ax = plt .subplot (121 )
147- ax .scatter (list ( xrange ( 10 )), list ( xrange ( 10 , 0 , - 1 ) ), label = 'three' )
146+ ax .scatter (np . arange ( 10 ), np . arange ( 10 , 0 , - 1 ), label = 'three' )
148147 ax .legend (loc = "center left" , bbox_to_anchor = [1.0 , 0.5 ],
149148 title = "My legend" )
150149
151150 mpl .rcParams ['legend.scatterpoints' ] = 1
152151 plt .figure ()
153152 ax = plt .subplot (121 )
154- ax .scatter (list ( xrange ( 10 )), list ( xrange ( 10 , 0 , - 1 ) ), label = 'one' )
153+ ax .scatter (np . arange ( 10 ), np . arange ( 10 , 0 , - 1 ), label = 'one' )
155154 ax .legend (loc = "center left" , bbox_to_anchor = [1.0 , 0.5 ],
156155 title = "My legend" )
157156
0 commit comments