#!/usr/bin/env python

import optparse

from rasmus.common import *

o = optparse.OptionParser()
o.add_option("-t", "--type", default="points")
o.add_option("-b", "--buckets", default=20, type="int")
conf, args = o.parse_args()

if len(args) == 0:
    infile = sys.stdin
else:
    infile = args[0]

data = util.read_delim(infile, parse=True)

if conf.type == "hist":
    x = cget(data, 0)
    plothist(x, conf.buckets)

elif len(data[0]) == 1:
    x = cget(data, 0)
    plot(x, style=conf.type)

elif len(data[0]) == 2:
    x, y = cget(data, 0, 1)
    plot(x, y, style=conf.type)

time.sleep(1e6)


