Author |
Topic  |
|
uwepres
USA
1 Posts |
Posted - 07/13/2002 : 10:28:34 AM
|
I have a family of curve in a worksheet of the for f(x,y_0); col(1) contains the x data, col(2) the y value, all the same value, and column 3 is the measured value (fluorescence in this case). I increment the y value and take another curve. My worksheet consist of a number of these triplets of columns, with all the values of the y column, in each triplet the same. It is straightforward to make a 3D XYZ trajectory plot and add all the curves to the layer. But what I really want are true surface and contour plots.
I have tried matrix conversion, but the results are nothing like the surface that should result. I am running 6.0 with the R4 patch. I cut and paste all the triplets so that there is just 3 columns in the whole worksheet before conversion (following the example of 2D binning in the sample data--the energy vs. position data), but the results dont make sense. I noticed too that if one plays with that 2D binning sample data, that, if one sorts the data into ascending or descending value, say for column 1, then the matrix conversion is entirely different. I bring this up for in this case the columns have many repeated values, such as the case with my data).
Well, I better stop. How does one make a matrix conversion with a data set that is essentially a family of curves created by incrementing a (spatial) parameter? |
|
easwar
USA
1965 Posts |
Posted - 07/14/2002 : 09:16:36 AM
|
Hello,
There may be more than one way to do what you want. One rather simple way is as follows:
1> Create a worksheet with just the z columns - you can do this by simply duplicating (right-click on worksheet window title bar and choose Duplicate) your existing triplets worksheet and then deleting all the x and y columns. 2> With this new worksheet as the active window, choose the menu item Edit->Convert to Matrix->Direct, to perform a cell by cell conversion of the worksheet to a matrix 3> With the new matrix window as the active window, choose the menu item Matrix->Set Dimensions. Then leave the Dimensions group as is in the dialog, and change the Coordinates settings by putting in start and end values for x and y - you know these values from your original worksheet. 4> Now you can create surface, contour plots etc. from the matrix
The above assumes that in your original data the x and y values are spaced regularly - step value does not change. If this is not true, then it becomes more complicated to convert and you may need to write a special script.
A note on the other matrix conversion methods available from the menu:
Direct: Each cell in the worksheet becomes a cell in the matrix - this is the method we used above.
2D Binning: This is essentially histogramming in 2 dimensions. It is useful when all you have is x,y count statistics and no z data, and want to bin them into a 2D matrix. By the way, in the 2D binning example, we show how to put constrains on one of the parameters (x or y) so that binning is done based on the constraint.
Regular: Here, the data needs to be in x,y,z format where the x and y columns both vary regularly - for each x value, the whole range of y values need to be specified or vice versa - and there is a z value associated with each x,y value
Random: The data is again in x,y,z format where both x and y vary, but now they do not have to be regularly spaced - the conversion can be done using different algorithms - there are 3 algorithms in ver 6x, and 5 in ver 7x.
Hope the above helps.
Easwar OriginLab.
|
 |
|
easwar
USA
1965 Posts |
Posted - 07/14/2002 : 11:32:34 AM
|
Hello,
Here is another way, perhaps easier than the one posted before. 1> Copy the script at the end of this message, and save it to a text file named xyzappend.ogs 2> Make the source worksheet with the multiple xyz columns active 3> Open the script window (menu command Window->Script Window) 4> Type the following line in the script window and hit return:
run.section(xyzappend,main)
This will create a new worksheet with three columns, xyz, that has all the triplet data in the source worksheet appended together.
5> Highlight the Z column in the new worksheet and choose the menu item Edit->Conver to Matrix, and then choose Regular XYZ or Random XYZ depending on the nature (step spacing) of your data
Easwar OriginLab.
// Script starts here [main] %s = %h; // save source worksheet name maxcol = wks.ncols; // save no. of cols in wks win -t wks; // create a new worksheet %d = %h; // save destination worksheet name work -a 1; // add a column wks.col3.type = 6; // set column type as Z // loop thru groups of triples in source dataset for(ii=1; ii<=maxcol; ii+=3) { copy -a %(%s,ii) %(%d,1); // copy/append x copy -a %(%s,ii+1) %(%d,2); // copy/append y copy -a %(%s,ii+2) %(%d,3); // copy/append z } // Script ends here |
 |
|
|
Topic  |
|
|
|