3
3
import nose , nose .tools as nt
4
4
import numpy .testing as nptest
5
5
6
+
6
7
import matplotlib
7
8
matplotlib .use ('Agg' )
8
9
import matplotlib .pyplot as plt
@@ -20,20 +21,22 @@ def test_markevery():
20
21
# check marker only plot
21
22
fig = plt .figure ()
22
23
ax = fig .add_subplot (111 )
23
- ax .plot (x , y , 'o' )
24
- ax .plot (x , y , 'd' , markevery = None )
25
- ax .plot (x , y , 's' , markevery = 10 )
26
- ax .plot (x , y , '+' , markevery = (5 , 20 ))
24
+ ax .plot (x , y , 'o' , label = 'default' )
25
+ ax .plot (x , y , 'd' , markevery = None , label = 'mark all' )
26
+ ax .plot (x , y , 's' , markevery = 10 , label = 'mark every 10' )
27
+ ax .plot (x , y , '+' , markevery = (5 , 20 ), label = 'mark every 5 starting at 10' )
28
+ ax .legend ()
27
29
fig .canvas .draw ()
28
30
plt .close (fig )
29
31
30
32
# check line/marker combos
31
33
fig = plt .figure ()
32
34
ax = fig .add_subplot (111 )
33
- ax .plot (x , y , '-o' )
34
- ax .plot (x , y , '-d' , markevery = None )
35
- ax .plot (x , y , '-s' , markevery = 10 )
36
- ax .plot (x , y , '-+' , markevery = (5 , 20 ))
35
+ ax .plot (x , y , '-o' , label = 'default' )
36
+ ax .plot (x , y , '-d' , markevery = None , label = 'mark all' )
37
+ ax .plot (x , y , '-s' , markevery = 10 , label = 'mark every 10' )
38
+ ax .plot (x , y , '-+' , markevery = (5 , 20 ), label = 'mark every 5 starting at 10' )
39
+ ax .legend ()
37
40
fig .canvas .draw ()
38
41
plt .close (fig )
39
42
0 commit comments