"""Sampler of matplotlib dashing."""

import numpy as N
import pylab as P

# Dash format is a sequence of even length of ink-on, ink-off points.  For
# example, (4,2) means 4 points on, 2 off.
dashes= [ (1,0),
          (8,3),
          (10,4),
          (2,2),
          (4,2),
          (6,3,3,3),
          (3,3,3,6),
          (24,4),
          (14,4),
          (10,4,4,4),
          (10,2,2,2),
          (15,2,6,2),
          ]

y = N.ones(10)+N.rand(10)

P.rc('lines', linewidth=2)

P.figure()

for i,dashpat in enumerate(dashes):
    P.plot(y,dashes=dashpat,color='k')
    P.text(-3.5,i+1.5,'%s: %s' % (i,dashpat))
    y = y+1

P.title('Matplotlib dashing patterns')
P.xlim(-4,10)
P.ylim(0.5,len(dashes)+1.5)
P.show()
# EOF
