-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathplots.py
30 lines (21 loc) · 831 Bytes
/
plots.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
import numpy as np
from matplotlib import pyplot as plt
def plot_abundance(ground_truth, estimated, em, save_dir):
plt.figure(figsize=(12, 6), dpi=150)
for i in range(em):
plt.subplot(2, em, i + 1)
plt.imshow(ground_truth[:, :, i], cmap='jet')
for i in range(em):
plt.subplot(2, em, em + i + 1)
plt.imshow(estimated[:, :, i], cmap='jet')
plt.tight_layout()
plt.savefig(save_dir + "abundance.png")
def plot_endmembers(target, pred, em, save_dir):
plt.figure(figsize=(12, 6), dpi=150)
for i in range(em):
plt.subplot(2, em // 2 if em % 2 == 0 else em, i + 1)
plt.plot(pred[:, i], label="Extracted")
plt.plot(target[:, i], label="GT")
plt.legend(loc="upper left")
plt.tight_layout()
plt.savefig(save_dir + "end_members.png")