File: line_styles.py

package info (click to toggle)
matplotlib 0.98.1-1%2Blenny4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 18,624 kB
  • ctags: 22,599
  • sloc: python: 76,915; cpp: 63,459; ansic: 5,353; makefile: 111; sh: 12
file content (26 lines) | stat: -rw-r--r-- 722 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python
from pylab import *

t = arange(0.0, 3.0, 0.05)
s = sin(2*pi*t)
styles = ('-', '--', ':', '.', 'o', '^', 'v', '<', '>', 's', '+')
colors = ('b', 'g', 'r', 'c', 'm', 'y', 'k')


axisNum = 0
for row in range(5):
    for col in range(4):
        s = sin(2*pi*t)
        axisNum += 1
        subplot(5,4,axisNum)
        style = styles[axisNum % len(styles) ]
        color = colors[axisNum % len(colors) ]
        plot(t,s, style + color)
        # turn off the ticklabels if not first row or first col
        if not gca().is_first_col():
            setp(gca(), 'yticklabels', [])
        if not gca().is_last_row():
            setp(gca(), 'xticklabels', [])

#savefig('line_styles', dpi=300)
show()