-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplotlog.py
37 lines (28 loc) · 930 Bytes
/
plotlog.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#from plotter import *
import os
import sys
import numpy as np
import pandas as pd
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from plotter import *
from matplotlib import rc
from matplotlib import rcParams
rcParams.update({'figure.autolayout': True})
font = {'size': 15}
rc('font', **font)
if __name__ == '__main__':
if len(sys.argv) == 1:
file = None
else:
file = os.path.splitext(sys.argv[1])[0]
if file is None:
all_files = [f for f in os.listdir("logs") if os.path.isfile(os.path.join("logs", f))]
csv_list = [os.path.splitext(f)[0] for f in all_files if os.path.splitext(f)[1]=='.csv']
png_list = [os.path.splitext(f)[0] for f in all_files if os.path.splitext(f)[1]=='.png']
fname_list = [f for f in csv_list if f not in png_list]
else:
fname_list = [file]
for fname in fname_list:
plot_log(fname)