I am trying to plot .npy-files containing 3d arrays (values in range from -90 to 315) with matplotlib and I am constantly getting an almost completely white image, with only a few colorful spots.
This is my code:
file = "file.npy"
img_array = np.load(file)
img = (img_array - img_array.min()) / (img_array.max() - img_array.min()) * 255
plt.imshow(img, vmin=0, vmax=255)
plt.show()
And this is the result:
Does anyone know why that is and how I can plot my image properly? Thank you!
Solution: The values in my array were of dtype float32. Once I changed them to dtype int8 it worked!