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
 Plot Long Name
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

_Sigma

1 Posts

Posted - 06/25/2009 :  7:44:08 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 8
Operating System: xp

I have a workbook with multiple sheets. Each column of each sheet is Y. Plotting using an implicit X.

I am plotting via

for (int ii=3; ii<=wkbname$!wks.ncols; ii++)
{
plotxy [wkbname$](1:end)!($(ii)) plot:=200 ogl:=[<NEW>]!;
}

to get the same column from all worksheets onto one graph.

However, I'd like to rename the graph to the long name of the column.
If I put this under the plot and assign it to the name
[workbook$]1!wks.col($(ii))[L]$
it ends up returning "[wkbname$](1:end)!($(ii)) plot:=200 ogl:=[<NEW>]!"

Any ideas?

cpyang

USA
1406 Posts

Posted - 06/27/2009 :  10:11:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The following code should do the trick, it will work by using worksheet column designation, so if there is no X, then it will plot with implicit X.


string wkbname$="Book1";
range wks1=[wkbname$]1!; // 1st sheet
for (int ii=3; ii<=wks1.ncols; ii++)
{
	range y1 = [wkbname$]1!wcol(ii);//take LN from 1st sheet
	string strColLN = y1[L]$;
	plotxy [wkbname$](1:end)!(?, $(ii)) plot:=200 ogl:=[<NEW>]!;
	//result plot is the active window
	page.LongName$=strColLN$;
}


See this link for the XYRange notation of (?,col) for the implicit designations.

http://wiki.originlab.com/~originla/wiki/index.php?title=LabTalk:Range_Notation#Special_Notations_with_XYRange_using_.23_and_.3F_for_X

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