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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Several curves on a graph

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
leftsara Posted - 05/26/2010 : 06:23:13 AM
I use a script to import multiple files at once in the Origin, and make a graph for each set of columns (B,G) of each file imported. But I needed to do only one graph which contains all curves (B,G) of all the files I imported in order to compare them. Does anyone know what I have to add in my script? Thanks Sara

Script:

getfile -m *.lvm;
for(i=1;i<=count;i+=1)
{
getfile -g i;
win -t data;
open -w %A;
sum = 0;
loop(ii, 59900, 60000)
{
sum += Col(C)[ii];
}
media = sum/100;
wo -a 2;
Col(G) = ((Col(C)-media)/media)*100;
Col(H) = media/Col(C);
plotxy iy:=(2,7);
}
4   L A T E S T    R E P L I E S    (Newest First)
leftsara Posted - 05/28/2010 : 05:16:51 AM
Thank you Vincent, you greatly simplify my daily work. Sara
VincentLiu Posted - 05/27/2010 : 11:51:47 PM
By using the Win -m command, it would create a graph with mutiple layers and all the layers would have their own axes. So it may be a little difficult to let all layers share the same scales. But you may modify your scripts as I did in the post below, which will add all plots in the same layer. So all plots will share the same scales.

Script:

win -t p; //create an empty graph
%B=page.name$; //Get its name
win -h; //Hide it


getfile -m *.lvm;
for(i=1;i<=count;i+=1)
{
getfile -g i;
win -t data;
open -w %A;
sum = 0;
loop(ii, 59900, 60000)
{
sum += Col(C)[ii];
}
media = sum/100;
wo -a 2;
Col(G) = ((Col(C)-media)/media)*100;
Col(H) = media/Col(C);

plotxy iy:=(2,7) o:=[%B]1!; //Add all plots in the same layer of the same graph
}

Vincent
OriginLab Technical Services
leftsara Posted - 05/27/2010 : 11:43:28 AM
Thanks for the help, now I can get a graph with the curve of each file, but I'm still having trouble with the axes of the graph. Even using the function layarrange, I can't get the axes of the graph with only one common scale for all curves. Do you know how to do that?
VincentLiu Posted - 05/27/2010 : 05:47:55 AM
You could try with the Win -m command out of the For loop first. The Win -m command could merge all the graphs in the same folder of the Project Explore (the hidden graphs cannot be involved to be merged). The new graph should contain multiple layers, each of which includes one of the source graphs. For more details about the command, please refer to

http://wiki.originlab.com/~originla/wiki/index.php?title=LabTalk:Window_%28command%29#-m.3B_Merge_all_graph_windows

If you want to rearrange the layer of the graph, you could try to use the layarrange function to do it. For more details about this function, you could refer to

http://wiki.originlab.com/~originla/wiki2/index.php?title=X-Function:Layarrange

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000