T O P I C R E V I E W |
Insomnia |
Posted - 09/26/2003 : 11:41:37 PM 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.
|
1 L A T E S T R E P L I E S (Newest First) |
greg |
Posted - 10/15/2003 : 11:27:44 AM 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 |
|
|