I have read a Dataset in NC file using netCDF4 in python and then tried to plot the dataset using matplotlib.pyplot. But issue is the plot shows the image but with 90 Degrees clockwise rotation. Following code I have used:
from netCDF4 import Dateset import matplotlib.pyplot as plt f = Dataset(r'F:\data\data.nc', 'r') data = f['et'][:] plt.imshow(data) plt.show()
Kindly let me know what can be the issue.
Also one doubt I am having, I have 2 NC files having same dataset and in that, dataset in one file is getting properly displayed by using np.rot90(data) which was suggested to me in the answer given below and in another file I need not to do "np.rot90(data)" but instead I need to do "data[::-1]" to display the data correctly.... And interesting thing is when I am importing these 2 files directly in the Arcmap both are getting properly displayed....can u suggest what can be the issue? Whether it's the issue with NC data?