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
 How to plot graph function with changing parameter
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Insomnia

Hong Kong
7 Posts

Posted - 09/26/2003 :  11:41:37 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I would like to plot a series of graph functions, say y=a+bx where range of x is fixed but many different pairs of parameter a and b. Three columns in the worksheet are ready, col(A) for x, col(B) for parameter a, col(C) for parameter b. So far, I can only add the graph function one by one, like y = a(i) + b(i)x, is there any better solution? Many thanks in advance.

greg

USA
1379 Posts

Posted - 10/15/2003 :  11:27:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Origin can define functions and will display those functions for the X range if a graph window is active.

So, we don't even need an X column. Here is a script that plots all the functions (I assume there are two columns - one for each parameter - in the worksheet window which is active):

// BEGIN SCRIPT
%M=%H; // Get the Worksheet name
get col(1) -e end; // How many rows of values
win -t plot line Functions; // Open a new Line graph window
getn (X Minimum) XMin (X Maximum) XMax (Enter X Range); // Prompt
X1=XMin;
X2=XMax;
queue {
loop(ii,1,end) {
F$(ii)(X) = %(%M,1,ii) + %(%M,2,ii)) * X; // Create functions
}
}
doc -uw;
layer -a; // Rescales Y
// END SCRIPT

NOTE: Once you've done this, Origin does not allow you to re-define the function. You first must delete the function(s) with:
delete F1
or
loop(ii,1,10) {delete F$(ii);}




Edited by - greg on 10/22/2003 10:02:57 AM
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