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 for Programming
 LabTalk Forum
 Several curves on a graph
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

leftsara

3 Posts

Posted - 05/26/2010 :  06:23:13 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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);
}

VincentLiu

China
Posts

Posted - 05/27/2010 :  05:47:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

leftsara

3 Posts

Posted - 05/27/2010 :  11:43:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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?
Go to Top of Page

VincentLiu

China
Posts

Posted - 05/27/2010 :  11:51:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Edited by - VincentLiu on 05/28/2010 03:02:10 AM
Go to Top of Page

leftsara

3 Posts

Posted - 05/28/2010 :  05:16:51 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you Vincent, you greatly simplify my daily work. Sara
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