forked from kroitor/asciichart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pplot
21 lines (18 loc) · 731 Bytes
/
pplot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from argparse import ArgumentParser
from asciichartpy import plot
def parse_args():
parser = ArgumentParser()
parser.add_argument("series", type=float, nargs="+")
parser.add_argument("--offset", type=int)
parser.add_argument("--height", type=float)
parser.add_argument("--format", help="Format for tick numbers.")
parser.add_argument("--minimum", type=float, help="Min y value.")
parser.add_argument("--maximum", type=float, help="Max y value.")
return parser.parse_args()
if __name__ == "__main__":
args = vars(parse_args())
series = args.pop("series")
cfg = {k: v for k, v in args.items() if v is not None}
print(plot(series, cfg))