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
 Assigning Numbers to TicksByData$
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

cdrozdowski111

USA
247 Posts

Posted - 12/10/2012 :  07:22:37 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 9.0.0 (Student Version), Win7 64-bit, running in VMware Fusion 5.0.2

If I have a series of numbers that I want to assign to TicksByData$ property of a TopX layer in an LT script, can I do it and how? I'd really rather not have to get the numbers from a worksheet.

Series of numbers: 677 682 692 695 701 704 716 717 726 727 729

Example code to add TopX layer to active graph:

layadd type:=TopX activate:=1 userdef:=1 linkto:=1 xaxis:=straight yaxis:=0 bottom:=0 left:=0 top:=1 right:=0;
range ll = !;
ll.x2.TicksByData$ = <series of numbers from above>;

greg

USA
1378 Posts

Posted - 12/10/2012 :  1:01:22 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Unfortunately, TicksByData does not work with Loose Datasets so you cannot do something like:
Dataset dsTBD = {677, 682, 692, 695, 701, 704, 716, 717, 726, 727, 729};
and use that by
ll.x2.TicksByData$ = dsTBD;

So you will need to add a column to your worksheet and fill it with those values. Then you can that column as your ticks:
range raw = [Book1]Sheet1!;
raw.AddCol(TBD);
range raTBD = [Book1]Sheet1!TBD;
raTBD = {677, 682, 692, 695, 701, 704, 716, 717, 726, 727, 729};
layadd type:=TopX activate:=1 userdef:=1 linkto:=1 xaxis:=straight yaxis:=0 bottom:=0 left:=0 top:=1 right:=0;
range ll = !;
ll.x2.TicksByData$ = raTBD;
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