The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 contour plot for nonlinear xyz data
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

flirt

USA
Posts

Posted - 07/01/2004 :  12:13:26 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Dear guys,

I'm new user of Origin and need learn a lot but seems not have enough time......I met this simple task to draw contour plot for a set of data. The 3d data is like this: x for position, y for temperature, at each temperature a dataset is obtained. Both x and y are not linear. Would anybody tell me how to do interpolation to get a matrix so that I can draw the contour plot easily?
Please keep in mind that I'm new and know little, so please be instructive, step by step
thx

Mike

USA
357 Posts

Posted - 07/01/2004 :  1:19:42 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi flirt,

This may or may not be possible depending upon just how "nonlinear" your x and y data are. If you are new to Origin, the best thing for you to do would be to browse to your \Samples\Analysis\Worksheet to Matrix folder (under the Origin program folder) and open the Worksheet to Matrix.OPJ. When you read the "Understanding Matrices" notes -- be sure, by the way, to open your Project Explorer window (ALT + 1) -- you will see that it says:
quote:
Matrices have numbered columns which are mapped to linearly spaced X values and numbered rows which are mapped to linearly spaced Y values.


If your x and y values are just a bit irregularly spaced, you may be able to convert your worksheet data using the Random conversion method (This is explained in a Notes window in the Random folder in this same Origin sample project).

Good luck. Let us know if we can be of further assistance.

Mike
OriginLab
Go to Top of Page

flirt

USA
Posts

Posted - 07/01/2004 :  2:41:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi mike, thanks for reply.
I certainly have checked the tutorial and search on technical support but found no similar talk.....
The data I have in excel is like a huge (m*n) matrix with x and y nonregular(but not exotic of course, only not linear), just like this(first row x, first column y):
I 20 23 25 ......
0.1 0.2 0.6 0.9 ......
0.15 0.25 0.67 0.96 ......
......


i just want to get a color-fill contour for these data so to have a visual presentation about how the data developed, but i don't know why Origin doesn't have this function.
The Random example in that project only accept data well arranged point by point(i.e., only 3 columns), which is hard for me to do because i have so many data points and they are already in matrix form....
Go to Top of Page

Mike

USA
357 Posts

Posted - 07/01/2004 :  4:25:40 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Okay. So, if I understand correctly, you have an Excel workbook with your X values in the first row, and your Y values in the first column. At each row/column intersection, you have a Z value. If your X and Y data were regularly spaced, this would be no problem. You would do a Direct worksheet to matrix conversion (this is explained in the "Direct" folder in that same Origin sample project -- Worksheet to Matrix.OPJ).

However, since your X and Y values are not regularly spaced, this poses a problem. In this illustration, I made an Origin worksheet that has unevenly-spaced X values in the first row, unevenly-spaced Y values in the first column and Z values "in between."



Using Origin 7.5, I can do a Direct conversion, but note that when Origin creates the matrix, it tries to create X and Y values by linear interpolation between the lowest and highest X and Y values. This results -- as you can see -- in a distortion of your data. Instead of value 0.39649 plotting at the intersection of X=1,Y=2, it is plotted at X=1,Y=1.68182... Not ideal.

If you are simply plotting this to gain some insight into your data it may be of some value, but I don't think you could say that the resulting graph is a true representation.

Maybe someone else has some thoughts...


Mike
OriginLab

Edited by - Mike on 07/01/2004 5:08:12 PM
Go to Top of Page

Mike

USA
357 Posts

Posted - 07/02/2004 :  11:21:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Okay, I think we have a solution for you. Yesterday, we discussed the uneven spacing of your X and Y data and how this would necessitate your using a Random gridding method to create the Origin matrix (from which you could create your contour plot). Unfortunately, your data was in a form that didn't allow you to do that. However, someone here reminded me that Origin ships with a specialized worksheet template that may solve your dilemma.

Do this:

1. Select the Open Template button on the Standard toolbar (tenth button from left).
2. Browse to the Buttons folder in the Origin program folder.
3. Set the Files of Type drop-down to Worksheet Template (*.otw) and open the file named CONVERT.OTW. This opens a custom Origin worksheet template.
4. Set Input Form Choice to Y in first column and X in first row.
5. Select and copy your Excel data into this custom template.
6. Click the Convert to XYZ Worksheet button.
7. Name the receiving worksheet (or accept default) and click OK.

This creates a worksheet with three columns -- X,Y, and Z. This rearrangement of your excel "matrix" data will allow you to use one of Origin's Random gridding methods.

8. Select the C(Z) column of your new worksheet.
9. Choose Edit:Convert to Matrix:Random XYZ....
9. In the Random XYZ Gridding dialog box, select a gridding method (Renka-Cline is default) and click OK.

If all goes well, your data will be converted into an Origin matrix and you'll then be able to create your contour plot by choosing Plot:Contour Plot... from the menu.

Mike
OriginLab
Go to Top of Page

flirt

USA
Posts

Posted - 07/06/2004 :  10:12:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Mike, thanks so much, this does work, although takes so long time.
BTW, what is the best gridding method? Some of the interpolated values seem not so accurate. I also draw the contour map with original data by assigning constant steps, the shapes of the two maps look a bit different.
Go to Top of Page

Mike

USA
357 Posts

Posted - 07/06/2004 :  12:19:30 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi flirt:

If your array is very large it could well take a while to create either the XYZ worksheet or to do the gridding.

As to which method is best, that will depend on your data. We supply five gridding methods because there is no single "best method." One thing you can do -- and you may already have done this -- is to select the Show Plot check box in the Random XYZ Gridding dialog box. This will show you how closely your XYZ data correspond to the gridded data; use the Apply button to compare results and find your "best method."

If you are using Origin 7.5, you can get a bit more information on the various gridding methods by reading through the Help file topic (Help:Origin) Converting Random XYZ Data.

Mike
OriginLab
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000