Bryan Fodness wrote: > Could someone give me an idea how to get started with this so it > coincides with my array of values. I took a look at the quadmesh_demo > in the examples and do not see a straightforward way to do this
Maybe the docstrings make it sound more complicated than it really is. In your case you have an array of rectangles, not general quadrilaterals. All you need are two 1-D arrays, one each for the x and y grid boundaries. Something like this: Z = numpy.random.rand(60,4000) X = numpy.arange(4001) Y = numpy.array([0, 1.4] + [1.0]*9 + [0.5]*40 + [1]*9 + [1.4]).cumsum() pcolor(X, Y, Z) pcolormesh should work the same, but when I try it now with svn it doesn't; I don't know what is going on with it. If you are using a release version of mpl, I expect it will work. Eric > > On Nov 26, 2007 7:52 AM, Michael Droettboom <[EMAIL PROTECTED]> wrote: >> You can provide mesh coordinates to the pcolor command: >> >> X and Y, if given, specify the (x,y) coordinates of the colored >> quadrilaterals; the quadrilateral for C[i,j] has corners at >> (X[i,j],Y[i,j]), (X[i,j+1],Y[i,j+1]), (X[i+1,j],Y[i+1,j]), >> (X[i+1,j+1],Y[i+1,j+1]). Ideally the dimensions of X and Y >> should be one greater than those of C; if the dimensions are the >> same, then the last row and column of C will be ignored. >> >> Actually generating the mesh is up to you (wink), but hopefully that >> allows for what you need to do. >> >> Cheers, >> Mike >> >> >> Bryan Fodness wrote: >>> I am wondering if there is a way to view my data with respect to the >>> physical size of what my array element is suppose to be. >>> >>> I have an array that is 60 x 4000 where, >>> the first row has a height of 1.4 >>> the next nine has a height of 1 >>> the next forty has a height of 0.5 >>> the next nine has a height of 1 >>> and the last one has a height of 1.4 >>> >>> When viewing this with contourf or pcolor, the image is more narrow >>> than it should be. Is there an easy way to view this properly. >>> >>> Bryan >>> >> -- >> Michael Droettboom >> Science Software Branch >> Operations and Engineering Division >> Space Telescope Science Institute >> Operated by AURA for NASA >> > > > ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users