def rugplot(a, height=0.05, axis='x', ax=None, **kwargs):
 if (ax is None):
  ax = plt.gca()
 a = np.asarray(a)
 vertical = kwargs.pop('vertical', (axis == 'y'))
 func = (ax.axhline if vertical else ax.axvline)
 kwargs.setdefault('linewidth', 1)
 for pt in a:
  func(pt, 0, height, **kwargs)
 return ax

def rugplot ( a , height = 0.05 , axis = 'x' , ax = None , ** kwargs ) : if ( ax is None ) : ax = plt . gca ( ) a = np . asarray ( a ) vertical = kwargs . pop ( 'vertical' , ( axis == 'y' ) ) func = ( ax . axhline if vertical else ax . axvline ) kwargs . setdefault ( 'linewidth' , 1 ) for pt in a : func ( pt , 0 , height , ** kwargs ) return ax
plot datapoints in an array as sticks on an axis .