bugGNU Octave - Bugs: bug #39650, tightinset update is wrong after...

 
 

bug #39650: tightinset update is wrong after change of fig position

Submitter:  Ben Abbott <bpabbott>
Submitted:  Fri 02 Aug 2013 01:06:34 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  5 - Blocker
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  bpabbott
Originator Name:  Ben Abbott Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 12 Aug 2013 11:56:40 AM UTC, comment #7: 

I'm seeing a failure the first time tests are run on graphics.cc


>> test graphics.cc
  ***** test
 hf = figure ("visible", "off");
 graphics_toolkit (hf, "fltk");
 unwind_protect
   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"));
   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, 1e-4);
   assert (cell2mat (get (hax, "outerposition")), outerpositions, 1e-4);
   assert (cell2mat (get (hax, "looseinset")), looseinsets, 1e-4);
   assert (cell2mat (get (hax, "tightinset")), tightinsets, 1e-4);
 unwind_protect_cleanup
   close (hf);
 end_unwind_protect
!!!!! test failed
assert (cell2mat (get (hax, "position")),positions,1e-4) expected
   0.13000   0.58384   0.77500   0.32733
   0.13000   0.12384   0.77500   0.32733
but got
   0.13000   0.12384   0.77500   0.32733
   0.13000   0.58384   0.77500   0.32733
maximum absolute error 0.46 exceeds tolerance 0.0001


The test fails due to the axes objects being in the wrong order. Subsequently, all tests pass.


test graphics.cc
PASSES 19 out of 19 tests


I'll open a new bug report.

Ben Abbott <bpabbott>
Group Member
Sun 11 Aug 2013 08:48:52 PM UTC, comment #6: 
Ben Abbott <bpabbott>
Group Member
Sun 11 Aug 2013 02:23:42 AM UTC, comment #5: 

I ran a test that looks to indicate the problem is in graphics.cc (i.e. not _init_fltk_.cc)


clf
plot (rand (3))
set (gca, 'activepositionproperty', 'position')
set (gcf, 'position', [pos(1:2),2*pos(3:4)])
set (gcf, 'position', [pos(1:2),pos(3:4)])
get (gcf, 'outerposition')
ans =  -1  -1  -1  -1


I'm still lost as to what is happening.

Ben Abbott <bpabbott>
Group Member
Sat 03 Aug 2013 12:59:54 PM UTC, comment #4: 

Changing the xlabel, ylabel, or title restores the tightinset to its proper values and renders the figure correctly.

I don't understand what it happening.  If anyone has an idea, please comment.

Ben Abbott <bpabbott>
Group Member
Sat 03 Aug 2013 02:04:58 AM UTC, comment #3: 

Maybe the problem is in  graphics.cc (axes::properties::get_extent ()) ?


Ben Abbott <bpabbott>
Group Member
Sat 03 Aug 2013 01:11:54 AM UTC, comment #2: 

Removing the "regression", and elevating the severity to blocker.

Ben Abbott <bpabbott>
Group Member
Sat 03 Aug 2013 01:06:51 AM UTC, comment #1: 

The problem looks to be with the "tightinset" property.  The tightinset should be identical in each case.


plot (rand (3))
get (gca, 'tightinset')
ans =   0.046429   0.011915   0.000000   0.023810
set (gcf (), 'position', [pos(1:2), 1.5*pos(3:4)])
get (gca, 'tightinset')
ans =   0.074281   0.000000   0.000000   0.040873
set (gcf (), 'position', pos)
get (gca, 'tightinset')
ans =   0.00000   0.48787   0.45250   0.00000


I'm changing the summary to be more descriptive.

Ben Abbott <bpabbott>
Group Member
Fri 02 Aug 2013 01:06:34 PM UTC, original submission:  


 plot (rand (3))
pos = get (gcf (), 'position');
set (gcf (), 'position', [pos(1:2), 1.5*pos(3:4)])


Figure looks reasonable.  However, the menubar height is taller, and should remain a fixed height (to maintain esthetics).

Returning the figure to its original position shrinks the axes.


set (gcf (), 'position', pos)
get (gca (), 'position')
ans =   0.13000   0.48787   0.41750   0.43713


I've attached the figure which results.

Enlarging the figure a second time fixed the axes position.


set (gcf (), 'position', [pos(1:2), 1.5*pos(3:4)])
get (gca (), 'position')
ans =   0.13000   0.11000   0.77500   0.81500


I haven't had the time to isolate the problem, but my guess is that either (1) a dormant old bug has been awakened by recent changes to _init_flltk_.cc, or (2) the recent changes broke some implicit interdependence.

Ben Abbott <bpabbott>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #28742:  shrunk-axes.png added by bpabbott (45KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bpabbott (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-08-12 bpabbott StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2013-08-11 bpabbott Item GroupNone Incorrect Result
        StatusNone Ready For Test
        Assigned toNone bpabbott
    2013-08-03 bpabbott Severity3 - Normal 5 - Blocker
        Item GroupRegression None
    2013-08-03 bpabbott Summarychanging fig position shrinks FLTK axes tightinset update is wrong after change of fig position
    2013-08-02 bpabbott Attached File- Added shrunk-axes.png, #28742

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code