I have a question about histogram2d. Say I do something like:

import numpy
from numpy import random
import pylab

x=random.rand(1000)-0.5
y=random.rand(1000)*10-5

xbins=numpy.linspace(-10,10,100)
ybins=numpy.linspace(-10,10,100)
h,x,y=numpy.histogram2d(x,y,bins=[xbins,ybins])

pylab.imshow(h,interpolation='nearest')
pylab.show()

The output is attached. I think I would have expected the transpose of what 
numpy histogram2d returned, so the tight x distribution appears along the x 
axis in the image. Maybe I am thinking about this incorrectly, or there is a 
convention I am unfamiliar with. If the behavior is correct, could the 
docstring include a comment explaining the orientation of the histogram 
array?

Thanks,
Darren

-- 
Darren S. Dale, Ph.D.
Staff Scientist
Cornell High Energy Synchrotron Source
Cornell University
275 Wilson Lab
Rt. 366 & Pine Tree Road
Ithaca, NY 14853

[EMAIL PROTECTED]
office: (607) 255-3819
fax: (607) 255-9001
http://www.chess.cornell.edu

<<attachment: hist2dimage.png>>

_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to