bugGNU Octave - Bugs: bug #39327, subplot "looseinset",...

 
 

bug #39327: subplot "looseinset", "position" and "outerposition" are wrong

Submitter:  Ben Abbott <bpabbott>
Submitted:  Sun 23 Jun 2013 11:20:53 AM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
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
   

Sat 27 Jul 2013 12:44:24 PM UTC, comment #5: 

No reports of problems, so I'm closing.

Ben Abbott <bpabbott>
Group Member
Fri 19 Jul 2013 02:52:22 PM UTC, comment #4: 
Ben Abbott <bpabbott>
Group Member
Sat 06 Jul 2013 08:45:34 PM UTC, comment #3: 

Several changesets have been pushed in the last week.  The bug reported by Stefan in comment #2 has gone away.

The legend is not rendered properly.  The updated results for the test script in comment #1 are below.


Matlab "position"      = [0.13000, 0.58380, 0.59200, 0.34120]
Octave "position"      = [0.09642, 0.55289, 0.70827, 0.37330]
Matlab "outerposition" = [0.00000, 0.54570, 1.00000, 0.40970]
Octave "outerposition" = [0.05357, 0.51481, 0.75112, 0.43519]
Matlab "tightinset"    = [0.03930, 0.03810, 0.00890, 0.01900]
Octave "tightinset"    = [0.04285, 0.03808, 0.00000, 0.02381]
Matlab "looseinset"    = [0.13000, 0.08530, 0.27800, 0.07500]
Octave "looseinset"    = [0.04285, 0.03808, 0.00000, 0.02381]


As far as I can tell, the outerposition's width should not be modified to make room for  the legend.

Ben Abbott <bpabbott>
Group Member
Fri 28 Jun 2013 12:04:04 PM UTC, comment #2: 

With gnuplot frontend, the plot area gets smaller and smaller if the following code is excecuted several times.


plot(1:2); legend('a'); print test.png


The problem disappears if I revert legend.m to a changeset before
http://hg.savannah.gnu.org/hgweb/octave/rev/286904321282

Stefan Mahr <dac922>
Sun 23 Jun 2013 11:33:49 AM UTC, comment #1: 

The "outerposition" property for the prior example represents the combination of the "position" and "tightinset".

However, the "outerpositon" property should only be modified when the "activepositionproperty" is equal to "postion", and when the axes+labels+title+ticklabels (i.e. position+tightinset) collectively exceed the size of the "outerposition" property.  In this case, the "outerposition" property must be expanded.



Ben Abbott <bpabbott>
Group Member
Sun 23 Jun 2013 11:20:53 AM UTC, original submission:  


figure (2, '__graphics_toolkit__', 'fltk')
clf ()
subplot (2, 1, 1)
plot (rand (3))
legend ({'blue', 'green', 'red'}, 'location', 'northeastoutside')
set (flipud (findall (gcf (), '-property', 'fontsize')), 'fontsize', 10)
tightinset = get (gca (), 'tightinset');
looseinset = get (gca (), 'looseinset');
position = get (gca (), 'position');
outerposition = get (gca (), 'outerposition');

matlab_looseinset = [0.13, 0.0853, 0.278, 0.075];
matlab_tightinset = [0.0393, 0.0381, 0.0089, 0.0190];
matlab_position = [0.13, 0.5838, 0.592, 0.3412];
matlab_outerposition = [0, 0.5457, 1, 0.4097];

printf ('\nMatlab "position"      = [%.5f, %.5f, %.5f, %.5f]\n', double (matlab_position))
printf ('Octave "position"      = [%.5f, %.5f, %.5f, %.5f]\n', double (position))
printf ('Matlab "outerposition" = [%.5f, %.5f, %.5f, %.5f]\n', double (matlab_outerposition))
printf ('Octave "outerposition" = [%.5f, %.5f, %.5f, %.5f]\n', double (outerposition))
printf ('Matlab "tightinset"    = [%.5f, %.5f, %.5f, %.5f]\n', double (matlab_tightinset))
printf ('Octave "tightinset"    = [%.5f, %.5f, %.5f, %.5f]\n', double (tightinset))
printf ('Matlab "looseinset"    = [%.5f, %.5f, %.5f, %.5f]\n', double (matlab_looseinset))
printf ('Octave "looseinset"    = [%.5f, %.5f, %.5f, %.5f]\n', double (looseinset))


The script above produces the result below.


Matlab "position"      = [0.13000, 0.58380, 0.59200, 0.34120]"
Octave "position"      = [0.09643, 0.55284, 0.73638, 0.37335]"
Matlab "outerposition" = [0.00000, 0.54570, 1.00000, 0.40970]"
Octave "outerposition" = [0.04999, 0.51000, 0.78282, 0.44000]"
Matlab "tightinset"    = [0.03930, 0.03810, 0.00890, 0.01900]"
Octave "tightinset"    = [0.04644, 0.04284, 0.00000, 0.02381]"
Matlab "looseinset"    = [0.13000, 0.08530, 0.27800, 0.07500]"
Octave "looseinset"    = [0.05932, 0.09737, 0.00000, 0.05411]"


The "tightinset" may also be wrong, or the variance may be due to a different font (both Matlab and Octave are using 10pt font).

(Note: The problems with these axes properties interferes with rendering the legend correctly)

Ben Abbott <bpabbott>
Group Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dac922 (Posted a comment)
  • -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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-07-27 bpabbott StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2013-07-19 bpabbott StatusNone Ready For Test
        Assigned toNone bpabbott

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code