I need to plot 2D "heat map" using python using data from my file. My file has 3 columns x,y, value. x goes from 1 to 199 and y from 1 to 49. I've managed to use code from here: Make a 2D pixel plot with matplotlib but my area is rectangular and I need it to be "lying" rectangle, but code above makes it "standing" rectangle.
Any way how to rotate it by 90 degrees anti-clockwise or transpose the data? I'm very new to python and all the solutions I've found doesn't work...
Here's my code that produces "standing" rectangle:
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
x,y,temp = np.loadtxt('snorm000990987662298').T
nrows, ncols = 199, 49
grid = temp.reshape((nrows, ncols))
plt.imshow(grid, cmap=cm.gist_gray)
plt.show()