Let's say I have some input:
data = np.random.normal(loc=100,scale=10,size=(500,1,32)) hist = np.ones((32,20)) # initialise hist for z in range(32): hist[z],edges = np.histogram(data[:,0,z],bins=np.arange(80,122,2))
I can build it using imshow() :
plt.imshow(hist,cmap='Reds')
receipt:

However, the x-axis values ββdo not match the input (i.e., the average value is 100, from 80 to 122). So I would like to change the x axis to show the values ββin edges .
I tried:
ax = plt.gca() ax.set_xlabel([80,122])
and
ax.set_xticklabels(edges) ...

Any ideas on how to change the axis values ββto reflect the input I'm using?
python numpy matplotlib
atomh33ls Sep 09 '13 at 10:23 2013-09-09 10:23
source share