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
|
|
|