[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #60759] test subplot fails on hi-res display
From: |
Markus Mützel |
Subject: |
[Octave-bug-tracker] [bug #60759] test subplot fails on hi-res display |
Date: |
Thu, 10 Jun 2021 09:29:14 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36 Edg/91.0.864.41 |
Follow-up Comment #1, bug #60759 (project octave):
In the thread Dmitri linked in the OP, we found that the "position" property
is off by a few pixels.
Copied together from across different postings, on Dmitri's monitor:
>> hf = figure();
>> get(hf, 'position')
ans =
300 207 560 413
>> get(groot, 'defaultfigureposition')
ans =
300 200 560 420
>> for ii=1:9 hax(ii) = subplot(3,3,ii); endfor
>> get(hax(4), 'position')
ans =
0.1300 0.4421 0.1576 0.1508
>> hax_new = subplot (2,1,1);
>> get(hax_new, 'position')
ans =
0.1300 0.6248 0.7750 0.3002
On my monitor:
>> hf = figure;
>> get(hf, 'position')
ans =
300 204 560 416
>> get(groot, 'defaultfigureposition')
ans =
300 200 560 420
>> for ii = 1:9
hax(ii) = subplot (3,3,ii);
endfor
>> get(hax(4), 'position')
ans =
0.1300 0.4255 0.1818 0.1840
>> hax_new = subplot (2,1,1);
>> get(hax_new, 'position')
ans =
0.1300 0.5999 0.7750 0.3251
The failing BIST might just be a consequence of the figures having different
sizes. In that case, subplot (probably correctly) uses different positions for
the axes in the grid.
It looks like with that slightly different layout, the middle row of the 3x3
grid does *not* overlap with the upper axes of the 2x1 grid on Dmitri's
monitor.
But they do on mine.
@Dmitri: Could you please test if this modified test works for you?
hf = figure ("visible", "off");
set (hf, "position", get (groot, "defaultfigureposition")); # FIXME: This
step shouldn't be necessary
unwind_protect
for ii = 1:9
hax(ii) = subplot (3,3,ii);
endfor
subplot (3,3,1);
assert (gca (), hax(1));
subplot (2,1,1);
assert (ishghandle (hax),[false(1,6), true(1,3)]);
unwind_protect_cleanup
delete (hf);
end_unwind_protect
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?60759>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/