Why is the subtitle position changing?

Note. This problem occurs in 2016b in my case.

I am trying to make a figure with 3x4 villains together, with a sticker ticking only on the left and bottom substrings. However, when I run the code below, the first graph seems to resize:

figure
hold on
n = 12;
ax = gobjects(n,1);
for k = 1:n
pos = [0.1+0.2*(mod(k-1,4)), 0.65-0.3*floor(k/4-0.01), 0.2, 0.3]
ax(k) = subplot(3,4,k,'Position',pos);
end
set(ax(1:8),'XTick',[])
set(ax([2:4 6:8 10:12]),'YTick',[])

Please note that I am typing pos. The output for the first subtitle is

pos =

    0.1000    0.6500    0.2000    0.3000

but when I then double check the position of the first subtitle ...

ax(1).Position

ans =

    0.1300    0.7093   0.1566    0.2157

and the plot is as follows: enter image description here

In addition, I subsequently tried to manipulate the position of the first subtitle, but this only worsens the situation, see below:

ax(1).Position = [0.1000, 0.6500, 0.2000, 0.3000];

enter image description here

All help appreciated!

+4
source share
1 answer

R2016b. , , :

figure
hold on
n = 12;
ax = gobjects(n,1);
for k = 1:n
    pos = [0.1+0.2*(mod(k-1,4)), 0.65-0.3*floor(k/4-0.01), 0.2, 0.3]
    ax(k) = subplot(3,4,k);
    set(ax(k),'Position',pos);
end
set(ax(1:8),'XTick',[])
set(ax([2:4 6:8 10:12]),'YTick',[])

, , .

. , , , PlotBoxAspectRatio of [0.9670 1.0000 0.9670], PlotBoxAspectRatio of [0.8889 1.0000 0.8889]. "" PlotBoxAspectRatio of [0.8889 1.0000 0.8889]. , .

+3

Source: https://habr.com/ru/post/1669033/


All Articles