Re: Problem with numpy 2D Histogram

2014-06-20 Thread Jamie Mitchell
On Friday, June 20, 2014 9:46:29 AM UTC+1, Jamie Mitchell wrote: > Hi folks, > > > > I'm trying to plot a 2D histogram but I'm having some issues: > > from pylab import * > > import numpy as np > > import netCDF4 > > hist,xedges,yedges=np.histogram2d(x,y,bins=10) > > extent=[xedges[0],xedge

Re: Problem with numpy 2D Histogram

2014-06-20 Thread Peter Otten
Jamie Mitchell wrote: > On Friday, June 20, 2014 12:00:15 PM UTC+1, Peter Otten wrote: >> Jamie Mitchell wrote: >> >> >> >> > I have changed my x and y data to float64 types but I am still getting >> > the >> >> > same error message? >> >> >> >> Please double-check by adding >> >> >> >>

Re: Problem with numpy 2D Histogram

2014-06-20 Thread Jamie Mitchell
On Friday, June 20, 2014 12:00:15 PM UTC+1, Peter Otten wrote: > Jamie Mitchell wrote: > > > > > I have changed my x and y data to float64 types but I am still getting the > > > same error message? > > > > Please double-check by adding > > > > assert x.dtype == np.float64 > > assert y.dt

Re: Problem with numpy 2D Histogram

2014-06-20 Thread Peter Otten
Jamie Mitchell wrote: > I have changed my x and y data to float64 types but I am still getting the > same error message? Please double-check by adding assert x.dtype == np.float64 assert y.dtype == np.float64 If none of these assertions fail try to make a minimal script including some data tha

Re: Problem with numpy 2D Histogram

2014-06-20 Thread Jamie Mitchell
On Friday, June 20, 2014 10:25:44 AM UTC+1, Peter Otten wrote: > Jamie Mitchell wrote: > > > > > Hi folks, > > > > > > I'm trying to plot a 2D histogram but I'm having some issues: > > > from pylab import * > > > import numpy as np > > > import netCDF4 > > > hist,xedges,yedges=np.histogra

Re: Problem with numpy 2D Histogram

2014-06-20 Thread Peter Otten
Jamie Mitchell wrote: > Hi folks, > > I'm trying to plot a 2D histogram but I'm having some issues: > from pylab import * > import numpy as np > import netCDF4 > hist,xedges,yedges=np.histogram2d(x,y,bins=10) > extent=[xedges[0],xedges[-1],yedges[0],yedges[-1]] > imshow(hist.T,extent=extent,inter

Problem with numpy 2D Histogram

2014-06-20 Thread Jamie Mitchell
Hi folks, I'm trying to plot a 2D histogram but I'm having some issues: from pylab import * import numpy as np import netCDF4 hist,xedges,yedges=np.histogram2d(x,y,bins=10) extent=[xedges[0],xedges[-1],yedges[0],yedges[-1]] imshow(hist.T,extent=extent,interpolation='nearest') colorbar() show() Af