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
 a contour plot by using three sets of matrices
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

vahidh

USA
2 Posts

Posted - 06/06/2017 :  11:20:18 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I am trying to generate a contour plot in originpro. I was successful to make this plot in matlab by using 3 sets of matrices. The related explanation is provided here from matlab website.

Does anyone know how to do the same in originpro? Thank you


contourf(X,Y,Z), contourf(X,Y,Z,n), and contourf(X,Y,Z,v) draw filled contour plots of Z using X and Y to determine the x and y values.

If X and Y are matrices, then their sizes must equal the size of Z. Typically, you should set X and Y so that the columns are strictly increasing or strictly decreasing and the rows are uniform (or the rows are strictly increasing or strictly decreasing and the columns are uniform).

yuki_wu

896 Posts

Posted - 06/07/2017 :  01:24:52 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Do you want to plot a contour from XYZ data? Please take a look at this tutorial:
http://www.originlab.com/doc/Tutorials/XYZ-Contour

Hope it helps.

Regards,
Yuki
OriginLab
Go to Top of Page

vahidh

USA
2 Posts

Posted - 06/07/2017 :  12:48:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you, Yuki. In the content of the link that you sent me contour plot based on three vectors are mentioned. Please correct me if I am mistaken. I am interested in the contour plot of three different matrices(X, Y, Z).


quote:
Originally posted by yuki_wu

Hi,

Do you want to plot a contour from XYZ data? Please take a look at this tutorial:
http://www.originlab.com/doc/Tutorials/XYZ-Contour

Hope it helps.

Regards,
Yuki
OriginLab




Vahid H

Edited by - vahidh on 06/07/2017 1:04:13 PM
Go to Top of Page

yuki_wu

896 Posts

Posted - 06/08/2017 :  06:33:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Vahid H,

I am sorry that we don’t support to create a contour plot directly from three different matrices(X, Y, Z) at present, but I have a workaround for what you want:

I suppose you have three matrices in the project, now you can
1. Convert three matrices to three worksheets respectively
(Select Matrix: Covert to Worksheet from Origin menu, and then select XYZ columns in Method item)
2. Put the Z columns of the three worksheets to a new worksheet together, and set as X column, Y column and Z column correspondingly.
(Select Worksheet: Copy Column to from Origin menu)
3. You have a new XYZ vector to create a contour plot now

I also have a piece of script for you. You can execute it in Script Window

//New 3 workbooks for converting matrices
loop(ii, 1, 3)
{
	newbook name:= "WBook$(ii)" option:=lsname;
}
//New workbook for result
newbook name:= "Result" option:=lsname;

ii = 1;
//Loop over all matrix books in project
doc -e M
{
	str$ = "WBook" + "$(ii)";
	m2w method:=xyz ow:=[%(str$)]Sheet1!;
	colcopy irng:=[%(str$)]Sheet1!Col(3) orng:=[Result]Sheet1!Col($(ii));
	ii++;
}



Hope it helps.

Regards,
Yuki
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