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
 loop and plot
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Smilik305

Germany
6 Posts

Posted - 10/09/2017 :  09:55:25 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

I'd like to plot every 5th column into the same graph in one layer. I came up with the following script:
int ii;
int nCols=wks.nCols;
for (ii=9;ii<=nCols; ii+=4)
{

plotxy [book4]sheet1!wcol(ii) plot:=200;
layer.x.type=2;
layer.y.type=2;
rescale;
}

But, intead, it plots every column in a separate layer. With an additional indication of o:=[Graph1] it plots every column in a separate plot.
Could you please help me modify the code so that it does the job I want?


Edited by - Smilik305 on 10/09/2017 09:56:13 AM

couturier

France
291 Posts

Posted - 10/10/2017 :  03:21:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Just specify the layer in which you want to plot your data:
o:=[Graph1]1!

as for
layer.x.type=2;
layer.y.type=2;
rescale;

it can be put outside of the loop. No need to execute these lines for each iteration
Go to Top of Page

Smilik305

Germany
6 Posts

Posted - 10/10/2017 :  04:45:31 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you!
Go to Top of Page

Cabesaso

USA
1 Posts

Posted - 10/13/2017 :  11:55:04 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
That works like a charm. Thanks from me as well Couturier!
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