1212import numpy as np
1313
1414from matplotlib .testing .decorators import image_comparison , cleanup
15- from matplotlib .cbook import MatplotlibDeprecationWarning
1615import matplotlib .pyplot as plt
1716import matplotlib as mpl
18- import matplotlib .patches as mpatches
1917import matplotlib .transforms as mtrans
20- import matplotlib .collections as mc
18+ import matplotlib .collections as mcollections
19+
2120
2221@image_comparison (baseline_images = ['legend_auto1' ], remove_text = True )
2322def test_legend_auto1 ():
@@ -110,7 +109,8 @@ def test_fancy():
110109 plt .subplot (121 )
111110 plt .scatter (list (xrange (10 )), list (xrange (10 , 0 , - 1 )), label = 'XX\n XX' )
112111 plt .plot ([5 ] * 10 , 'o--' , label = 'XX' )
113- plt .errorbar (list (xrange (10 )), list (xrange (10 )), xerr = 0.5 , yerr = 0.5 , label = 'XX' )
112+ plt .errorbar (list (xrange (10 )), list (xrange (10 )), xerr = 0.5 ,
113+ yerr = 0.5 , label = 'XX' )
114114 plt .legend (loc = "center left" , bbox_to_anchor = [1.0 , 0.5 ],
115115 ncol = 2 , shadow = True , title = "My legend" , numpoints = 1 )
116116
@@ -123,7 +123,8 @@ def test_framealpha():
123123 plt .legend (framealpha = 0.5 )
124124
125125
126- @image_comparison (baseline_images = ['scatter_rc3' , 'scatter_rc1' ], remove_text = True )
126+ @image_comparison (baseline_images = ['scatter_rc3' , 'scatter_rc1' ],
127+ remove_text = True )
127128def test_rc ():
128129 # using subplot triggers some offsetbox functionality untested elsewhere
129130 fig = plt .figure ()
@@ -221,8 +222,8 @@ def test_warn_args_kwargs(self):
221222 ax .legend ((lnc , lns ), labels = ('a' , 'b' ))
222223
223224 warn .assert_called_with ("You have mixed positional and keyword "
224- "arguments, some input will be "
225- "discarded." )
225+ "arguments, some input will be "
226+ "discarded." )
226227
227228
228229@image_comparison (baseline_images = ['legend_stackplot' ], extensions = ['png' ])
@@ -273,10 +274,10 @@ def test_nanscatter():
273274
274275@image_comparison (baseline_images = ['not_covering_scatter' ], extensions = ['png' ])
275276def test_not_covering_scatter ():
276- colors = ['b' ,'g' ,'r' ]
277+ colors = ['b' , 'g' , 'r' ]
277278
278279 for n in range (3 ):
279- plt .scatter ([n , ], [n , ], color = colors [n ])
280+ plt .scatter ([n ], [n ], color = colors [n ])
280281
281282 plt .legend (['foo' , 'foo' , 'foo' ], loc = 'best' )
282283 plt .gca ().set_xlim (- 0.5 , 2.2 )
@@ -301,9 +302,9 @@ def test_linecollection_scaled_dashes():
301302 lines1 = [[(0 , .5 ), (.5 , 1 )], [(.3 , .6 ), (.2 , .2 )]]
302303 lines2 = [[[0.7 , .2 ], [.8 , .4 ]], [[.5 , .7 ], [.6 , .1 ]]]
303304 lines3 = [[[0.6 , .2 ], [.8 , .4 ]], [[.5 , .7 ], [.1 , .1 ]]]
304- lc1 = mc .LineCollection (lines1 , linestyles = "--" , lw = 3 )
305- lc2 = mc .LineCollection (lines2 , linestyles = "-." )
306- lc3 = mc .LineCollection (lines3 , linestyles = ":" , lw = .5 )
305+ lc1 = mcollections .LineCollection (lines1 , linestyles = "--" , lw = 3 )
306+ lc2 = mcollections .LineCollection (lines2 , linestyles = "-." )
307+ lc3 = mcollections .LineCollection (lines3 , linestyles = ":" , lw = .5 )
307308
308309 fig , ax = plt .subplots ()
309310 ax .add_collection (lc1 )
0 commit comments