Axes OuterPosition going nuts

Okay, so I have an old GUIDE-created figure (with custom toolbar, which is the reason I still use it) containing 4 axes which I have sorted two-by-two. I have set the Figure and all Axes' units to normalized. The axes are displayed in the figure as shown below. When I request the Position or TightInset values I get the correct normalized values. However, when I request the OuterPosition for these axes I get some ridiculous values, see code below. When everything is set to normalized, why oh why am I getting these results. In fact; how should it even be possible that I get values outside the 0-1 range when all is set to normalized? Any ideas?
A(1:4).OuterPosition
ans =
-110.8247 -54.7364 193.1601 92.5802
ans =
-110.8247 -54.2364 193.1601 92.5802
ans =
-111.3247 -54.7364 193.1601 92.5802
ans =
-111.3247 -54.2364 193.1601 92.5802

Antworten (1)

Jan
Jan am 22 Jan. 2021
Bearbeitet: Jan am 22 Jan. 2021

0 Stimmen

When do you get these output position values? Before a drawnow or afterwards?
Please check again, if you are really checking the objects you thinks you are checking:
A(1).Color = [1,0,0]
drawnow
A(1).OuterPosition
A(1).Position
A(1).Units

3 Kommentare

Thanks for replying Jan. As requested, see below.
>> A(1).Color = [1, 0, 0];
>> drawnow
>> A(1).OuterPosition
ans =
-110.8247 -54.7364 193.1601 92.5802
>> A(1).Position
ans =
0.5639 0.0836 0.3722 0.3828
>> A(1).Units
ans =
'normalized'
When I change the outer position the following happens (look closely to see the tiny dot somewhere in the empty space at the bottom right).
>> A(1).OuterPosition = [0.5 0 0.5 0.5]
Sjouke Rinsma
Sjouke Rinsma am 22 Jan. 2021
Okay, so I am to exuse myself... I made a boo boo.
It apparently did not come to mind I was mistaken in expecting all normalized positional values to be between 0 and 1... scaling doet not imply limiting when considering variables that depend on each other.
I'm working in a several thousand lines of code in which the setting of the axes to 'normalized' was accidentally preceded by a setting of the axes position to a normalized value (e.g. [0 0.5 0.5 0.5]). Because I additionally use a function that automatically sorts the axes layout for a given figure, the position value was again set to the normalized value ([0 0.5 0.5 0.5]) resulting in the OuterPosition becoming as indicated before.
Jan
Jan am 23 Jan. 2021
I'm glad if your problem is solved. Debugging is a hard job, which can be solved with co-workers much easier.

Melden Sie sich an, um zu kommentieren.

Kategorien

Produkte

Version

R2020a

Tags

Gefragt:

am 22 Jan. 2021

Kommentiert:

Jan
am 23 Jan. 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by