[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: changes to graphics.cc and subplot.m
From: |
Stefan Mahr |
Subject: |
Re: changes to graphics.cc and subplot.m |
Date: |
Sat, 20 Jul 2013 16:59:09 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 |
>>>> 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>
----------------------------------------------------------------------
with figure(1):
----------------------------------------------------------------------
octave-cli:14> assert (cell2mat (get (hax, "tightinset")), tightinsets)
error: assert (cell2mat (get (hax, "tightinset")),tightinsets) expected
0.042857 0.013199 0.000000 0.026316
0.042857 0.013122 0.000000 0.026316
but got
0.042857 0.013199 0.000000 0.026316
0.042857 0.013199 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
- Re: changes to graphics.cc and subplot.m, (continued)
- Re: changes to graphics.cc and subplot.m, bpabbott, 2013/07/19
- Re: changes to graphics.cc and subplot.m, PhilipNienhuis, 2013/07/19
- Re: changes to graphics.cc and subplot.m, Michael D. Godfrey, 2013/07/19
- Re: changes to graphics.cc and subplot.m, Ben Abbott, 2013/07/19
- Re: changes to graphics.cc and subplot.m, PhilipNienhuis, 2013/07/19
- Re: changes to graphics.cc and subplot.m, Ben Abbott, 2013/07/19
Re: changes to graphics.cc and subplot.m, Stefan Mahr, 2013/07/20
- Re: changes to graphics.cc and subplot.m, Ben Abbott, 2013/07/20
- Re: changes to graphics.cc and subplot.m, Stefan Mahr, 2013/07/20
- Re: changes to graphics.cc and subplot.m, Ben Abbott, 2013/07/20
- Re: changes to graphics.cc and subplot.m,
Stefan Mahr <=
- Re: changes to graphics.cc and subplot.m, Ben Abbott, 2013/07/20
- Re: changes to graphics.cc and subplot.m, Dmitri A. Sergatskov, 2013/07/20
- Re: changes to graphics.cc and subplot.m, Benjamin Abbott, 2013/07/20
- Re: Re: changes to graphics.cc and subplot.m, Pantxo Diribarne, 2013/07/20
- Re: changes to graphics.cc and subplot.m, Ben Abbott, 2013/07/20
- Re: changes to graphics.cc and subplot.m, Ben Abbott, 2013/07/20
- Re: changes to graphics.cc and subplot.m, Stefan Mahr, 2013/07/21
- Re: changes to graphics.cc and subplot.m, Ben Abbott, 2013/07/21
- Re: changes to graphics.cc and subplot.m, Ben Abbott, 2013/07/21
- Re: changes to graphics.cc and subplot.m, Stefan Mahr, 2013/07/21