forked from navjotk/error_propagation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_subsampling.py
More file actions
34 lines (25 loc) · 802 Bytes
/
plot_subsampling.py
File metadata and controls
34 lines (25 loc) · 802 Bytes
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
from argparse import ArgumentParser
import matplotlib
import tikzplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt # noqa
from util import read_csv # noqa
description = ("Plot the errors from subsampling")
parser = ArgumentParser(description=description)
parser.add_argument("--filename", type=str, required=True)
args = parser.parse_args()
filename = args.filename
results = read_csv(filename)
basename = "subsampling"
xvar = 'f'
yvars = ['L1', 'L2', 'Linf', 'angle']
x_to_plot = results[xvar]
for yvar in yvars:
# plt.xscale('log')
plt.yscale('log')
plt.plot(x_to_plot, results[yvar])
plt.xlabel('cf')
plt.ylabel(yvar)
plt.savefig("%s_%s.pdf" % (basename, yvar), bbox_inches='tight')
tikzplotlib.save(("%s_%s.tex" % (basename, yvar)))
plt.clf()