Hi, Sorry for not giving sufficient detail. I open an HDF5 file and then read some EArray into a regular array:
a = f.root MySource = a.myLineSource[:,:,1] # the dimensions of my source are (x, t) = (50, 15000) 50 corresponds to 50 gridpoints where I have recorded an electric field. and 15,000 corresponds to the number of timesteps I have run in my simulation. figure() A1=contourf(MySource) # When I do this, it gives me a beautiful plot. However the x axis spans (0, 50) when I would like it to go from (0, 50)*DX. Similarly, in time, my plot spans (0, 15,000) when I would like it to range from (0, 15000)*DT Where DX and DT are some real numbers (e.g. a micron, and a femtosecond.) I would suspect there to be some 'scaling' feature already available in python for just this kind of thing. That is why I argued that introducing new arrays to incorporate the adjusted/properly scaled values would be a waste. Thanks again! On Fri, Feb 17, 2012 at 1:26 PM, Alexa Villaume <alexa7...@gmail.com> wrote: > Hi François, > > Why would it be a waste to multiply the values in an array by the scaling > factors? > > Can you provide an example of your code so everybody can get a better idea > of what you're doing now? > > Thanks, > Alexa > > On Fri, Feb 17, 2012 at 9:07 AM, Francois Lemery <francois.lem...@gmail.com> > wrote: >> >> Hi Python World! >> >> I currently have a 2D array: A[i][j] which I can plot very nicely >> using the contourf function. However, in this plot, the axes span >> from (0, i) and (0, j). >> I would like to multiply each axes by a scaling constant- thereby >> turning the array element values into physical quantities (distance >> and time for example). >> Could anyone help me with this? I've looked around, but so far the >> only solution I have found is to create a new set of arrays with these >> scaling factors included. I can do this, but I feel as though it >> would be a waste. >> >> -- >> Thanks! >> François >> >> >> ------------------------------------------------------------------------------ >> Virtualization & Cloud Management Using Capacity Planning >> Cloud computing makes use of virtualization - but cloud computing >> also focuses on allowing computing to be delivered as a service. >> http://www.accelacomm.com/jaw/sfnl/114/51521223/ >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- Thanks, François ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users