-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotter_multi.py
More file actions
54 lines (38 loc) · 1.13 KB
/
plotter_multi.py
File metadata and controls
54 lines (38 loc) · 1.13 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env python
#
# This may or may not need modification to run.
# But in general you should modify this to get
# the aesthetic you want for your plots.
# for headless runs
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import sys, getopt
def main():
# Get command line arguments
if( len(sys.argv) < 4 ):
print("Usage: {0} chart_title output.png file0.csv [file1.csv file2.csv ...]".format(sys.argv[0]))
sys.exit(2)
chart_title=sys.argv[1]
fig_fn=sys.argv[2]
csv_file_list= sys.argv[3:]
x_label="Size (p=m0)"
y_label="Performance (GFLOP/s)"
ymax = 1
fig, ax = plt.subplots()
for fn in csv_file_list:
df = pd.read_csv(fn)
xsize = df['m0']
res = df['result']
ax.plot(xsize, res,label=fn)
ymax=max(ymax,max(res))
ax.set(ylim=(0, ymax*1.5),
xlabel=x_label, ylabel=y_label,
title=chart_title)
plt.legend()
fig.savefig(fig_fn)
#plt.show() # comment out for headless (no gui) run
if __name__ == '__main__':
main()