octave-maintainers
[Top][All Lists]
Advanced

[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: Sat, 20 Jul 2013 11:36:21 -0400

On Jul 20, 2013, at 10:59 AM, Stefan Mahr wrote:

>>>>> The behaviour of subplot with fltk frontend looks strange. Also, the
>>>>> first fltk plot differs from the second.
>>>>> 
>>>>> 1) gnuplot
>>>>> graphics_toolkit gnuplot
>>>>> subplot(2,1,1); plot(rand(10,1)); subplot(2,1,2); plot(rand(10,1))
>>>>> 
>>>>> 2) fltk
>>>>> graphics_toolkit fltk
>>>>> subplot(2,1,1); plot(rand(10,1)); subplot(2,1,2); plot(rand(10,1))
>>>>> 
>>>>> 3) fltk
>>>>> graphics_toolkit fltk
>>>>> subplot(2,1,1); plot(rand(10,1)); subplot(2,1,2); plot(rand(10,1))
>>>>> subplot(2,1,1); plot(rand(10,1)); subplot(2,1,2); plot(rand(10,1))
>>>>> 
>>>>> See attached the screenshot of gnuplot, fltk and fltk second plot. (from
>>>>> left to right)
>>>>> 
>>>>> If I use additional figure command before subplot, everything looks ok.
>>>>> graphics_toolkit fltk
>>>>> figure(1)
>>>>> subplot(2,1,1); plot(rand(10,1)); subplot(2,1,2); plot(rand(10,1))
>>>>> subplot(2,1,1); plot(rand(10,1)); subplot(2,1,2); plot(rand(10,1))
>>>> 
>>>> I'm not seeing a problem.
>>>> 
>>>> graphics_toolkit fltk
>>>> close all
>>>> subplot(2,1,1); plot(rand(10,1)); subplot(2,1,2); plot(rand(10,1))
>>>> 
>>>> 
>>>> Then if I repeat the plot ...
>>>> 
>>>> subplot(2,1,1); plot(rand(10,1)); subplot(2,1,2); plot(rand(10,1))
>>>> 
>>>> Can you reproduce the problem when you begin with "close all"?
>>>> 
>>>> Ben
>>>> 
>>> 
>>> Did you restart octave first? Seems that subplot needs to be the first
>>> plot-related command, otherwise the error doesn't occur. That's why it
>>> works if figure(1) is executed before subplot.
>>> 
>>> Stefan
>> 
>> I'm still not able to reproduce the problem.  I've written a short script 
>> with tests.  If the problem is with Octave the script should produce a 
>> failure for you.  If the script does not produce a problem, the source of 
>> the problem will be difficult to track down (could be Octave or could be 
>> FLTK?).
>> 
>> Ben
> 
> 
> If I take the script as it is I get following output. When adding
> figure(1) before subplot, only the last assert returns an error (only
> minor differences).
> 
> 
> octave-cli:1> graphics_toolkit fltk
> octave-cli:2> subplot(2,1,1); plot(rand(10,1)); subplot(2,1,2);
> plot(rand(10,1))
> octave-cli:3> hax = findall (gcf (), "type", "axes");
> octave-cli:4> positions = cell2mat (get (hax, "position"));
> octave-cli:5> outerpositions = cell2mat (get (hax, "outerposition"));
> octave-cli:6> looseinsets = cell2mat (get (hax, "looseinset"));
> octave-cli:7> tightinsets = cell2mat (get (hax, "tightinset"));
> octave-cli:8> subplot(2,1,1); plot(rand(10,1)); subplot(2,1,2);
> plot(rand(10,1))
> octave-cli:9> hax = findall (gcf (), "type", "axes");
> octave-cli:10> assert (cell2mat (get (hax, "position")), positions)
> error: assert (cell2mat (get (hax, "position")),positions) expected
>   0.13000   0.18964   0.77500   0.26152
>   0.13000   0.60122   0.77500   0.30994
> but got
>   0.13000   0.18964   0.77500   0.26152
>   0.13000   0.64964   0.77500   0.26152
> values do not match
> error: called from:
> error:   /usr/share/octave/3.7.5/m/testfun/assert.m at line 235, column 5
> octave-cli:10> assert (cell2mat (get (hax, "outerposition")),
> outerpositions)
> octave-cli:11> assert (cell2mat (get (hax, "looseinset")), looseinsets)
> error: assert (cell2mat (get (hax, "looseinset")),looseinsets) expected
>   0.080000   0.073837   0.045000   0.038837
>   0.080000   0.073837   0.045000   0.038837
> but got
>   0.08000   0.13964   0.04500   0.03884
>   0.08000   0.13964   0.04500   0.03884
> values do not match
> error: called from:
> error:   /usr/share/octave/3.7.5/m/testfun/assert.m at line 235, column 5
> octave-cli:11> assert (cell2mat (get (hax, "tightinset")), tightinsets)
> error: assert (cell2mat (get (hax, "tightinset")),tightinsets) expected
>   0.04286   0.13964   0.00000   0.00000
>   0.04286   0.09122   0.00000   0.01696
> but got
>   0.042857   0.013208   0.000000   0.026316
>   0.042857   0.013208   0.000000   0.026316
> values do not match
> error: called from:
> error:   /usr/share/octave/3.7.5/m/testfun/assert.m at line 235, column 5
> octave-cli:11>

Ok.  Except for a difference in the tightinset in the 4 digit to the right of 
the decimal, he script runs cleanly for me.

Even so, it is good news that we can see the problem.  Before going further 
perhaps we should make sure there aren't any problem with the build process?  
Can you try a clean build and then run the script?

        hg purge
        ./bootstrap
        configure ....
        make ....
        ./run-octave --no-gui

You'll likely get the same result, but there is something unexpected happening, 
so I think this is a good place to start.

Ben



reply via email to

[Prev in Thread] Current Thread [Next in Thread]