2D heat map using python and matplotlib
Question: 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](http://stackoverflow.com/questions/6323737/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()
    


Answer: Try using
[`numpy.transpose`](http://docs.scipy.org/doc/numpy-1.10.1/reference/generated/numpy.transpose.html):

    
    
    grid = np.transpose(grid)
    plt.imshow(grid, cmap=cm.gist_gray)
    plt.show()
    

