Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#!/usr/bin/env python
import matplotlib as plt
import pandas as pd
import sys
import os
outname = "/tmp/plot-columns-{}.png".format(os.getpid())
infile = None
if len(sys.argv) > 1:
infile = sys.argv[1]
else:
infile = sys.stdin
# TODO: This only allows for up to 2 columns...
d = pd.read_csv(infile, header=None)
p = d.plot(linewidth=3,secondary_y=d.columns.values[1:], figsize=(25,8))
f = p.get_figure()
f.savefig(outname)
print outname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment