-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgt_mix.py
More file actions
26 lines (21 loc) · 786 Bytes
/
gt_mix.py
File metadata and controls
26 lines (21 loc) · 786 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
import numpy as np
import matplotlib.pyplot as plt
def show_four_npy(file1, file2, file3, file4, cmap="viridis"):
# Load the matrices
m1 = np.load(file1)
m2 = np.load(file2)
m3 = np.load(file3)
m4 = np.load(file4)
# Plot them
fig, axes = plt.subplots(1, 4, figsize=(16, 4))
mats = [m1, m2, m3, m4]
titles = [file1, file2, file3, file4]
for ax, mat, title in zip(axes, mats, titles):
im = ax.imshow(mat, cmap=cmap, aspect="auto")
ax.set_title(title, fontsize=8)
ax.axis("off")
fig.colorbar(im, ax=ax, fraction=0.046, pad=0.04)
plt.tight_layout()
plt.show()
# Example usage:
show_four_npy("/home/alejandro/test0.npy", "/home/alejandro/test0.npy","/home/alejandro/test0.npy","/home/alejandro/test0.npy")