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
 Can't position axis titles correctly

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 - 08/07/2022 : 9:15:55 PM
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.
2   L A T E S T    R E P L I E S    (Newest First)
Clairekun Posted - 08/08/2022 : 5:31:20 PM
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.
YimingChen Posted - 08/08/2022 : 11:12:39 AM
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

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