@@ -32,7 +32,7 @@ def test_colorcycle_basic():
3232def test_marker_cycle ():
3333 fig = plt .figure ()
3434 ax = fig .add_subplot (111 )
35- ax .set_prop_cycle (cycler ('color ' , ['r' , 'g' , 'y' ]) +
35+ ax .set_prop_cycle (cycler ('c ' , ['r' , 'g' , 'y' ]) +
3636 cycler ('marker' , ['.' , '*' , 'x' ]))
3737 xs = np .arange (10 )
3838 ys = 0.25 * xs + 2
@@ -48,7 +48,7 @@ def test_marker_cycle():
4848 fig = plt .figure ()
4949 ax = fig .add_subplot (111 )
5050 # Test keyword arguments, numpy arrays, and generic iterators
51- ax .set_prop_cycle (color = np .array (['r' , 'g' , 'y' ]),
51+ ax .set_prop_cycle (c = np .array (['r' , 'g' , 'y' ]),
5252 marker = iter (['.' , '*' , 'x' ]))
5353 xs = np .arange (10 )
5454 ys = 0.25 * xs + 2
@@ -67,7 +67,7 @@ def test_marker_cycle():
6767def test_linestylecycle_basic ():
6868 fig = plt .figure ()
6969 ax = fig .add_subplot (111 )
70- ax .set_prop_cycle (cycler ('linestyle ' , ['-' , '--' , ':' ]))
70+ ax .set_prop_cycle (cycler ('ls ' , ['-' , '--' , ':' ]))
7171 xs = np .arange (10 )
7272 ys = 0.25 * xs + 2
7373 ax .plot (xs , ys , label = 'solid' , lw = 4 )
@@ -85,7 +85,7 @@ def test_linestylecycle_basic():
8585def test_fillcycle_basic ():
8686 fig = plt .figure ()
8787 ax = fig .add_subplot (111 )
88- ax .set_prop_cycle (cycler ('color ' , ['r' , 'g' , 'y' ]) +
88+ ax .set_prop_cycle (cycler ('c ' , ['r' , 'g' , 'y' ]) +
8989 cycler ('hatch' , ['xx' , 'O' , '|-' ]) +
9090 cycler ('linestyle' , ['-' , '--' , ':' ]))
9191 xs = np .arange (10 )
@@ -131,7 +131,7 @@ def test_valid_input_forms():
131131 ax .set_prop_cycle (None )
132132 ax .set_prop_cycle (cycler ('linewidth' , [1 , 2 ]))
133133 ax .set_prop_cycle ('color' , 'rgywkbcm' )
134- ax .set_prop_cycle ('linewidth ' , (1 , 2 ))
134+ ax .set_prop_cycle ('lw ' , (1 , 2 ))
135135 ax .set_prop_cycle ('linewidth' , [1 , 2 ])
136136 ax .set_prop_cycle ('linewidth' , iter ([1 , 2 ]))
137137 ax .set_prop_cycle ('linewidth' , np .array ([1 , 2 ]))
@@ -181,6 +181,13 @@ def test_invalid_input_forms():
181181 'linewidth' , {'1' : 1 , '2' : 2 })
182182 assert_raises ((TypeError , ValueError ), ax .set_prop_cycle ,
183183 linewidth = 1 , color = 'r' )
184+ assert_raises ((TypeError , ValueError ), ax .set_prop_cycle , 'foobar' , [1 , 2 ])
185+ assert_raises ((TypeError , ValueError ), ax .set_prop_cycle ,
186+ foobar = [1 , 2 ])
187+ assert_raises ((TypeError , ValueError ), ax .set_prop_cycle ,
188+ cycler (foobar = [1 , 2 ]))
189+ assert_raises (ValueError , ax .set_prop_cycle ,
190+ cycler (color = 'rgb' , c = 'cmy' ))
184191
185192
186193if __name__ == '__main__' :
0 commit comments