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
 Can't position axis titles correctly
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Clairekun

Germany
175 Posts

Posted - 08/07/2022 :  9:15:55 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 2018b
Operating System: Win10

Hello,

I have some ternary graphs where I want to slightly change the default axis titles position.

With an existing graph, I move the labels manually and then, get the desired positions using commands like YR.x and YR.y.

If I run

YR.x = 0.506;
YR.y = 1.26;


It works fine and the original axis title position changes. However, if I include those lines in a loop over all graphs, the resulting labels are displaced.

Thinking there might be some differences in the conversion between the values and the real units Origin works with, I tried different position indicators: YR.x/YR.y, YR.x1/YR.y1, YR.top/YR.left. I aslo tried set name -ty xoffset. The displacement is different depending on the command used, but they're still always in the wrong place.

This only happens with axis titles; I used ObjectName.x1/y1 on the legend and another text label, also inside a loop, and it works as expected.

Is there anything I am missing? I assume it somehow has to do with the fact that the graph is ternary, but I still can't manage to get it right.

Thank you.

EDIT: After some fiddling, I realized the issue only happens for Y axis. The theme applied before the repositioning commands shows the right X/Y offset values, but Y axis is still misplaced. If I reapply the theme, nothing happens.

Edit 2: Since it is apparently impossible to correct Y axis position, I decided to delete it and create a new label with the same information:
label -r YR;
label -sl -p 50 5 -n TopY \b(%(?Y));

This finally worked, although it's not a solution per se but a lazy fix.

Edited by - Clairekun on 08/08/2022 10:26:57 AM

YimingChen

1684 Posts

Posted - 08/08/2022 :  11:12:39 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
How do you loop over all graphs? I tried the code below and it works fine.

doc -e P {
	YR.x = 0.506;
	YR.y = 1.26;
}


James
Go to Top of Page

Clairekun

Germany
175 Posts

Posted - 08/08/2022 :  5:31:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It's a doc -ef P command. It should work. The loop adds a new plot, applies a theme, has a legendupdate command, creates a secondary legend label, some commands for positioning those two legends, and then YR.x and YR.y commands.

The graph itself is enlarged compared to the default one. I can't think of any other relevant details. There are around 100 graphs in total.

YR label does move, it just ends up in a slightly different place. If I check its coordinates, X/Y offset, etc., they are not the same that I wrote in the code or typed in the theme.

Anyway, I'll have to use the fix. For some reason it won't work for me, I hope it's something on my part and it works for everyone else.

Thanks again.
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