[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #53214] area.m needs update to implement ShowB
From: |
Nicholas Jankowski |
Subject: |
[Octave-bug-tracker] [bug #53214] area.m needs update to implement ShowBaseline and other properties |
Date: |
Thu, 14 Sep 2023 09:37:58 -0400 (EDT) |
Update of bug #53214 (project octave):
Status: Confirmed => In Progress
_______________________________________________________
Follow-up Comment #13:
pushed a patch to default that simply adds Rik's suggested two lines to area.m
where suggested, and also adds a BIST checking xlim for a couple cases like
those shown in comment #8 and comment #9. also adds a fixme note that the
change might be better done inside graphics.cc rather than corrected after the
fact.
http://hg.savannah.gnu.org/hgweb/octave/rev/7997e785db0f
I was also going to make the same changes to plot.m, which has the same effect
of fixing the limits shown in comment #9, but the change causes 3 failures and
1 regression in the test suite, so I didn't push the change.
Two fails and a regression are in graphics.cc:
**** test
hf = figure ("visible", "off");
unwind_protect
hax = axes ("parent", hf);
plot (0, pi);
assert (get (hax, "xlim"), [-1, 1]);
assert (get (hax, "xlimmode"), "auto");
assert (get (hax, "ylim"), [2.8, 3.5], 2*eps);
assert (get (hax, "ylimmode"), "auto");
set (hax, "xlim", [1, 1], "ylim", [0, 0]);
assert (get (hax, "xlim"), [0.9, 1.1]);
assert (get (hax, "xlimmode"), "manual");
assert (get (hax, "ylim"), [0, 1]);
assert (get (hax, "ylimmode"), "manual");
set (hax, "xlim", [-Inf, Inf], "ylim", [-Inf, Inf]);
## Matlab does not update the properties
assert (get (hax, "xlim"), [0, 1]);
assert (get (hax, "ylim"), [0.9, 1.1]*pi, 2*eps);
unwind_protect_cleanup
delete (hf);
end_unwind_protect
!!!!! test failed
ASSERT errors for: assert (get (hax, "ylim"),[2.8, 3.5],2 * eps)
Location | Observed | Expected | Reason
(1) 2.8274 2.8 Abs err 0.027433 exceeds tol
4.4409e-16 by 0.03
(2) 3.4558 3.5 Abs err 0.044248 exceeds tol
4.4409e-16 by 0.04
***** test
hf = figure ("visible", "off");
unwind_protect
hax = axes ("parent", hf);
plot ([0, exp(1)], [-pi, 3]);
assert (get (hax, "xlim"), [0, 3]);
assert (get (hax, "xlimmode"), "auto");
assert (get (hax, "ylim"), [-4, 3]);
assert (get (hax, "ylimmode"), "auto");
set (hax, "xlim", [-Inf, Inf], "ylim", [-Inf, Inf]);
## Matlab does not update the properties but uses tight limits on screen
assert (get (hax, "xlim"), [0, exp(1)]);
assert (get (hax, "xlimmode"), "manual");
assert (get (hax, "ylim"), [-pi, 3]);
assert (get (hax, "ylimmode"), "manual");
unwind_protect_cleanup
delete (hf);
end_unwind_protect
!!!!! test failed
ASSERT errors for: assert (get (hax, "xlim"),[0, 3])
Location | Observed | Expected | Reason
(2) 2.7183 3 Abs err 0.28172 exceeds tol 0 by 0.3
***** test <*63624>
hf = figure ("visible", "off");
unwind_protect
hax = axes ("parent", hf);
plot (hax, [1, 201], [0, 1]);
assert (get (hax, "xtick"), 0:50:250);
axis (hax, "tight");
assert (get (hax, "xtick"), 50:50:200);
unwind_protect_cleanup
delete (hf);
end_unwind_protect
!!!!! regression: https://octave.org/testfailure/?63624
ASSERT errors for: assert (get (hax, "xtick"),0:50:250)
The third failure is in linkaxes
>>>>> processing /home/nrjank/source/octave/scripts/plot/util/linkaxes.m
***** test
hf1 = figure ("visible", "off");
hax1 = axes ();
plot (1:10);
hf2 = figure ("visible", "off");
hax2 = axes ();
plot (10:-1:1, "-*g");
hf3 = figure ("visible", "off");
hax3 = axes ();
plot (1:10:100, "-xb");
unwind_protect
linkaxes ([hax1, hax2, hax3]);
## Test initial values taken from first object in list
assert (xlim (hax3), [0 10]);
assert (ylim (hax3), [0 10]);
## Test linking
xlim (hax2, [2 8]);
assert (xlim (hax1), [2 8]);
assert (xlim (hax3), [2 8]);
ylim (hax3, "auto");
assert (ylim (hax1), [0 100]);
assert (ylim (hax2), [0 100]);
## Test re-linking removes old link
linkaxes ([hax1, hax2]);
ylim (hax3, [0 50]);
assert (ylim (hax1), [0 100]);
assert (ylim (hax2), [0 100]);
xlim (hax1, [0 4]);
assert (xlim (hax2), [0 4]);
## Test linking of remaining objects after deletion of one object
linkaxes ([hax1, hax2, hax3]);
xlim (hax2, [0 1]);
assert (xlim (hax1), [0 1]);
assert (xlim (hax3), [0 1]);
delete (hax2);
xlim (hax3, [0 2]);
assert (xlim (hax1), [0 2]);
## Test deletion of link
linkaxes ([hax1, hax3], "off");
xlim (hax3, [0 3]);
assert (xlim (hax1), [0 2]);
unwind_protect_cleanup
close ([hf1 hf2 hf3]);
end_unwind_protect
!!!!! test failed
ASSERT errors for: assert (xlim (hax3),[0, 10])
Location | Observed | Expected | Reason
(1) 1 0 Abs err 1 exceeds tol 0 by 1
that last one seems like it could just be arbitrarily changed to match the new
behavior, but not sure about the ones in graphics.cc.
If we want to leave plot.m alone, then this could just be Ready for Test, but
marking as In Progress for now.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?53214>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #53214] area.m needs update to implement ShowBaseline and other properties,
Nicholas Jankowski <=