[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: changes to graphics.cc and subplot.m
From: |
Ben Abbott |
Subject: |
Re: changes to graphics.cc and subplot.m |
Date: |
Thu, 01 Aug 2013 10:20:20 -0400 |
On Aug 1, 2013, at 9:07 AM, Stefan Mahr wrote:
>>>>>>>>>> oops! The test only fails for me the 1st time it is run, and only
>>>>>>>>>> because the axes handles are in the wrong order.
>>>>>>>>>>
>>>>>>>>>> Ben
>>>>>>>>>
>>>>>>>>> It's weird. With your test script I get the same results as you.
>>>>>>>>> However, the resulting output still has different y-axis size for both
>>>>>>>>> plots.
>>>>>>>>>
>>>>>>>>> If I copy-paste your example block-wise in interactive mode, I get
>>>>>>>>> more
>>>>>>>>> errors. Could it be some kind of timing problem?
>>>>>>>>
>>>>>>>> The extra errors are because the test aborts after the first error.
>>>>>>>>
>>>>>>>>> -----------
>>>>>>>>>
>>>>>>>>> graphics_toolkit fltk
>>>>>>>>> close all
>>>>>>>>> hf = figure (gcf (), "__graphics_toolkit__", "fltk", "visible", "on");
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> subplot(2,1,1); plot(rand(10,1)); subplot(2,1,2); plot(rand(10,1))
>>>>>>>>> hax = findall (gcf (), "type", "axes");
>>>>>>>>> positions = cell2mat (get (hax, "position"));
>>>>>>>>> outerpositions = cell2mat (get (hax, "outerposition"));
>>>>>>>>> looseinsets = cell2mat (get (hax, "looseinset"));
>>>>>>>>> tightinsets = cell2mat (get (hax, "tightinset"));
>>>>>>>>> close all
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> subplot(2,1,1); plot(rand(10,1)); subplot(2,1,2); plot(rand(10,1))
>>>>>>>>> hax = findall (gcf (), "type", "axes");
>>>>>>>>> assert (cell2mat (get (hax, "position")), positions, 0.001)
>>>>>>>>> assert (cell2mat (get (hax, "outerposition")), outerpositions, 0.001)
>>>>>>>>> assert (cell2mat (get (hax, "looseinset")), looseinsets, 0.001)
>>>>>>>>> assert (cell2mat (get (hax, "tightinset")), tightinsets, 0.001)
>>>>>>>>>
>>>>>>>>> ------------------------
>>>>>>>>>
>>>>>>>>>> assert (cell2mat (get (hax, "position")), positions, 0.001)
>>>>>>>>> error: assert (cell2mat (get (hax, "position")),positions,0.001)
>>>>>>>>> expected
>>>>>>>>> 0.13000 0.58384 0.77500 0.32733
>>>>>>>>> 0.13000 0.12384 0.77500 0.32733
>>>>>>>>> but got
>>>>>>>>> 0.13000 0.60122 0.77500 0.30994
>>>>>>>>> 0.13000 0.18964 0.77500 0.26152
>>>>>>>>> maximum absolute error 0.0658047 exceeds tolerance 0.001
>>>>>>>>> error: called from:
>>>>>>>>> error: /usr/share/octave/3.7.5/m/testfun/assert.m at line 235,
>>>>>>>>> column 5
>>>>>>>>>> assert (cell2mat (get (hax, "outerposition")), outerpositions, 0.001)
>>>>>>>>>> assert (cell2mat (get (hax, "looseinset")), looseinsets, 0.001)
>>>>>>>>>> assert (cell2mat (get (hax, "tightinset")), tightinsets, 0.001)
>>>>>>>>> error: assert (cell2mat (get (hax, "tightinset")),tightinsets,0.001)
>>>>>>>>> expected
>>>>>>>>> 0.042857 0.013122 0.000000 0.026316
>>>>>>>>> 0.042857 0.013199 0.000000 0.026316
>>>>>>>>> but got
>>>>>>>>> 0.04286 0.09122 0.00000 0.01696
>>>>>>>>> 0.04286 0.13964 0.00000 0.00000
>>>>>>>>> maximum absolute error 0.126443 exceeds tolerance 0.001
>>>>>>>>> error: called from:
>>>>>>>> error: /usr/share/octave/3.7.5/m/testfun/assert.m at line 235,
>>>>>>>> column 5
>>>>>>>>
>>>>>>>> The second error is the one I hoped to catch. I'll work in fixing the
>>>>>>>> test.
>>>>>>>>
>>>>>>>> Ben
>>>>>>>
>>>>>>> Does the attached version isolate the second error?
>>>>>>>
>>>>>>> Ben
>>>>>>
>>>>>> It's not related to the test itself, but line
>>>>>> hf = figure (gcf (), "__graphics_toolkit__", "fltk", "visible", "on");
>>>>>> fails for me. I need to add 'graphics_toolkit fltk' in the first line to
>>>>>> make it work.
>>>>>>
>>>>>>
>>>>>> If the test in run in script mode, it always pass. While testing Rik's
>>>>>> plot issue I realized, that subplot is not neccessary for catching the
>>>>>> y-axis bug. The optical difference is not as big as with subplot, so I
>>>>>> overlooked it in the past. With attached patch the bug is reproducable
>>>>>> in script mode. Please note the 'sleep(2)' after the plot command.
>>>>>> Without this sleep, the test pass without error.
>>>>>>
>>>>>>
>>>>>> Stefan
>>>>>
>>>>> Stefan / Dimitri / others,
>>>>>
>>>>> I'm still hoping to add some tests that demonstrate the problem.
>>>>>
>>>>> Does running this script produce one expected failure and 1 passing test?
>>>>>
>>>>> Ben
>>>>>
>>>>
>>>> No, since it's inverted. The first test passes, the second fails.
>>>>
>>>> However, it's still not 100% sure:
>>>>
>>>> octave-cli:44> test stefan; test stefan
>>>> [...]
>>>> PASSES 2 out of 2 tests (1 expected failure)
>>>> PASSES 2 out of 2 tests
>>>>
>>>> When calling 'test stefan' twice in one command line, the second run
>>>> passes both tests. It also happens when you copy&paste
>>>>
>>>> test stefan
>>>> test stefan
>>>>
>>>> to command line:
>>>>
>>>> octave-cli:68> test stefan
>>>> [...]
>>>> PASSES 2 out of 2 tests (1 expected failure)
>>>> octave-cli:69> test stefan
>>>> PASSES 2 out of 2 tests
>>>> octave-cli:70> test stefan
>>>> PASSES 2 out of 2 tests
>>>>
>>>> If you wait until the plot window is closed before starting new test, you
>>>> get the expected failure.
>>>>
>>>> Stefan
>>>
>>> Stefan, can I impose on you to modify the tests so that they give the
>>> result we desire (i.e. one failure and then a passing test)?
>>>
>>> Ben
>>>
>>>
>>
>> I wish I could.
>>
>> octave-cli:19> for i=1:10, stefan; end
>> PASSES 2 out of 2 tests (1 expected failure)
>> PASSES 2 out of 2 tests
>> PASSES 2 out of 2 tests
>> PASSES 2 out of 2 tests
>> PASSES 2 out of 2 tests
>> PASSES 2 out of 2 tests
>> PASSES 2 out of 2 tests (1 expected failure)
>> PASSES 2 out of 2 tests (1 expected failure)
>> PASSES 2 out of 2 tests
>> PASSES 2 out of 2 tests
>>
>>
>> Stefan
>>
>
> Ben,
>
> the problem above is fixed now (build with lastest changeset
> http://hg.savannah.gnu.org/hgweb/octave/rev/ea19ea629a09 )
>
> Stefan
Great! I don't see one, but did we open a bug report for this?
Ben