@@ -31,7 +31,7 @@ def test_colorcycle_basic():
3131def test_marker_cycle ():
3232 fig = plt .figure ()
3333 ax = fig .add_subplot (111 )
34- ax .set_prop_cycle (cycler ('color ' , ['r' , 'g' , 'y' ]) +
34+ ax .set_prop_cycle (cycler ('c ' , ['r' , 'g' , 'y' ]) +
3535 cycler ('marker' , ['.' , '*' , 'x' ]))
3636 xs = np .arange (10 )
3737 ys = 0.25 * xs + 2
@@ -47,7 +47,7 @@ def test_marker_cycle():
4747 fig = plt .figure ()
4848 ax = fig .add_subplot (111 )
4949 # Test keyword arguments, numpy arrays, and generic iterators
50- ax .set_prop_cycle (color = np .array (['r' , 'g' , 'y' ]),
50+ ax .set_prop_cycle (c = np .array (['r' , 'g' , 'y' ]),
5151 marker = iter (['.' , '*' , 'x' ]))
5252 xs = np .arange (10 )
5353 ys = 0.25 * xs + 2
@@ -66,7 +66,7 @@ def test_marker_cycle():
6666def test_linestylecycle_basic ():
6767 fig = plt .figure ()
6868 ax = fig .add_subplot (111 )
69- ax .set_prop_cycle (cycler ('linestyle ' , ['-' , '--' , ':' ]))
69+ ax .set_prop_cycle (cycler ('ls ' , ['-' , '--' , ':' ]))
7070 xs = np .arange (10 )
7171 ys = 0.25 * xs + 2
7272 ax .plot (xs , ys , label = 'solid' , lw = 4 )
@@ -84,7 +84,7 @@ def test_linestylecycle_basic():
8484def test_fillcycle_basic ():
8585 fig = plt .figure ()
8686 ax = fig .add_subplot (111 )
87- ax .set_prop_cycle (cycler ('color ' , ['r' , 'g' , 'y' ]) +
87+ ax .set_prop_cycle (cycler ('c ' , ['r' , 'g' , 'y' ]) +
8888 cycler ('hatch' , ['xx' , 'O' , '|-' ]) +
8989 cycler ('linestyle' , ['-' , '--' , ':' ]))
9090 xs = np .arange (10 )
@@ -130,7 +130,7 @@ def test_valid_input_forms():
130130 ax .set_prop_cycle (None )
131131 ax .set_prop_cycle (cycler ('linewidth' , [1 , 2 ]))
132132 ax .set_prop_cycle ('color' , 'rgywkbcm' )
133- ax .set_prop_cycle ('linewidth ' , (1 , 2 ))
133+ ax .set_prop_cycle ('lw ' , (1 , 2 ))
134134 ax .set_prop_cycle ('linewidth' , [1 , 2 ])
135135 ax .set_prop_cycle ('linewidth' , iter ([1 , 2 ]))
136136 ax .set_prop_cycle ('linewidth' , np .array ([1 , 2 ]))
@@ -179,6 +179,13 @@ def test_invalid_input_forms():
179179 'linewidth' , {'1' : 1 , '2' : 2 })
180180 assert_raises ((TypeError , ValueError ), ax .set_prop_cycle ,
181181 linewidth = 1 , color = 'r' )
182+ assert_raises ((TypeError , ValueError ), ax .set_prop_cycle , 'foobar' , [1 , 2 ])
183+ assert_raises ((TypeError , ValueError ), ax .set_prop_cycle ,
184+ foobar = [1 , 2 ])
185+ assert_raises ((TypeError , ValueError ), ax .set_prop_cycle ,
186+ cycler (foobar = [1 , 2 ]))
187+ assert_raises (ValueError , ax .set_prop_cycle ,
188+ cycler (color = 'rgb' , c = 'cmy' ))
182189
183190
184191if __name__ == '__main__' :
0 commit comments