-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_trial.py
36 lines (27 loc) · 1.01 KB
/
plot_trial.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
import pandas as pd
import os
import matplotlib.pyplot as plt
vet_trials = pd.read_csv('vet_trials.txt', delim_whitespace=True)
trials = vet_trials.query('Subcategory == "StearmanPT13"')
f, subplots = plt.subplots(len(trials), 3, figsize=(12, 12))
plt.tight_layout()
j = 0
for i, row in trials.iterrows():
subdir = os.path.join('VET_pngs', row['Category'])
file = row['tarname'].split('.')[0]
image = plt.imread(os.path.join(subdir, file + '.png'))
subplots[j, 0].imshow(image)
subplots[j, 0].set_title(file)
subplots[j, 0].axis('off')
file = row['dist1name'].split('.')[0]
image = plt.imread(os.path.join(subdir, file + '.png'))
subplots[j, 1].imshow(image)
subplots[j, 1].set_title(file)
subplots[j, 1].axis('off')
file = row['dist2name'].split('.')[0]
image = plt.imread(os.path.join(subdir, file + '.png'))
subplots[j, 2].imshow(image)
subplots[j, 2].set_title(file)
subplots[j, 2].axis('off')
j += 1
plt.savefig('trial_plot.png', bbox_inches='tight')