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
 Plotting XYYY in different graphs

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
Clairekun Posted - 04/02/2013 : 05:44:30 AM
Origin Ver. and Service Release (Select Help-->About Origin): 9
Operating System: Windows 7

Hello,

I have an XYYY worksheet where I want to plot graphs in different windows. I tried the follwing script:

for(int ii=2; ii<=wks.ncols; ii++) 
{
plotxy iy:=(1,$(ii))[378:632] plot:=200 ogl:=[<new>] 
}

Only one graph is plotted and I get the following error:

quote:
WKS.NCOLS: object property not found!


What am I doing wrong?
3   L A T E S T    R E P L I E S    (Newest First)
Clairekun Posted - 04/03/2013 : 04:39:32 AM
I understand my mistake now. It works like a charm, thanks!!
cdrozdowski111 Posted - 04/02/2013 : 06:59:49 AM
FYI- the reason your original script was failing was because when plotxy ran, the new graph became the active window instead of the workbook/worksheet. So the the script lost the context of the worksheet you were working from thereby causing the wks object to not be valid.

By specifying the full range to the worksheet, it doesn't have to be the active window anymore once the graphs started being created.
cdrozdowski111 Posted - 04/02/2013 : 06:41:45 AM
Try this. It might not be the most efficient route but does work based on quick testing. It assumes that the workbook/worksheet you want to plot is the active one.


string strWBName$ = page.name$; // Workbook name
string strWSName$ = wks.name$; // Worksheet name
int numCols = wks.ncols; // Number of columns in active worksheet

for (int ii = 2; ii <= numCols; ii++) 
{
	// Specify full range to worksheet columns
	plotxy iy:=[%(strWBName$)]"%(strWSName$)"!(1,$(ii))[378:632] plot:=200 ogl:=[<new>]; 
}

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