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
 Changing the rotation angle of data annotations
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

redman

UK
59 Posts

Posted - 10/24/2014 :  07:59:40 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 9.1SR3
Operating System:Winsdows 7

Is there a way to change the default rotation angle (or alignment) of data annotations or text labels by LabTalk?
By default, the text lable and data annotation are horizontally aligned. Although I can change one of the label then use the format copy and paste to reset other labels/annotations, I wonder if there is a more efficient way to do so.
I tried "set -qr 90", however it showed "#Command Error!" no mater the labels were created by a label column or by the data annotation tool.

Best regards,

Redman

Edited by - redman on 10/24/2014 08:01:33 AM

SeanMao

China
288 Posts

Posted - 10/26/2014 :  11:15:09 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Redman,

The syntax changing the rotation of text label or data label is set name -tr/-qr angle.

If you are using data label and all your plots in active graph layer are grouped, you can simply use set %C -qr angle to change all data labels' rotation angles in active layer where build-in string register %C is the name of current active dataset.

If the plots in active layer are independent and you want to change the rotation angle of one of the plots, use the following code:

range rr = [Graph1]Layer1!1; // For first plot in first layer in
                             // graph window Graph1
set rr -qr 90;


If you have a text label plot where you have label column (Designation Label) in column C for example, you can change the rotation of text labels by:

range rr = [Book1]Sheet1!C; //Label column in Book1 and Sheet1 
                            //Column C
set rr -tr 90;


If you want to change the rotation angle of added annotations, you can use the following commands for graphic objects:

Text.rotate = 30; // If the added text object's name is Text
                  // Right click to find object's name in 
                  // Programming Control dialog


For details about range notations, please refer to link below:
http://www.originlab.com/doc/LabTalk/Tutorials/Tutorial-Range-Notation

Regards!

Sean

OriginLab Technical Service
Go to Top of Page

redman

UK
59 Posts

Posted - 10/27/2014 :  06:12:50 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear SeanMao,

It helps a lot, many thanks! In the future version, is it possible to set a defaut customized angle? For example, I want to add a few peak labels with the data annotation tool, and I want the labels are vertically aligned. I wish to set the defaut rotation angle first, and then just mouse clicks!

Regards,

Redman
Go to Top of Page

SeanMao

China
288 Posts

Posted - 10/27/2014 :  06:34:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I just found out there is simple way you can save the rotation angle as default so all annotated labels will be shown in saved rotation angle as you have described.

To do so, create an arbitrary text label on one graph, right click on that text label and select "Properties" to open Object Properties dialog. Change Rotate (deg.) to 45 for instance, then click Set Default button and close the dialog.

The Set Default button is what you actually looking for. Cheers!

Regards!

Sean
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