imshow python code example
Example 1: pytorch plt.imshow
plt.imshow(images[0].permute(1, 2, 0))
Example 2: plt.imshow grayscale
plt.imshow(arr, cmap='gray', vmin=0, vmax=255)
Example 3: plt imshow python
import matplotlib.pyplot as plt
w = 4
h = 3
d = 70
plt.figure(figsize=(w, h), dpi=d)
x = [[3, 4, 5],
[2, 3, 4],
[1, 2, 3]]
color_map = plt.imshow(x)
color_map.set_cmap("Blues_r")
plt.colorbar()
plt.savefig("out.png")