bugGNU Octave - Bugs: bug #39326, initial "tightinset" is...

 
 

bug #39326: initial "tightinset" is wrong

Submitter:  Ben Abbott <bpabbott>
Submitted:  Sun 23 Jun 2013 11:14:05 AM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Inaccurate 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

Sun 28 Jul 2013 01:43:04 AM UTC, comment #6: 
Ben Abbott <bpabbott>
Group Member
Sat 27 Jul 2013 04:40:19 PM UTC, comment #5: 

I've attached a changeset that handles the initializes the tightinset before children are added to the axes.

(file #28673)

Ben Abbott <bpabbott>
Group Member
Sat 27 Jul 2013 12:43:14 PM UTC, comment #4: 

There remains a small bug.  The tightinset() is not updated when the axes are first created.


close all
get (gca, 'tightinset')
ans =   0   0   0   0


A start would be to add a call to sync_positions() to axes::update_font().

Ben Abbott <bpabbott>
Group Member
Thu 27 Jun 2013 12:54:53 AM UTC, comment #3: 

I'm looking at another changeset to simplify subplot.m (reduce the special gnuplot stuff).  I'l wait on that until this is resolved.

Ben Abbott <bpabbott>
Group Member
Wed 26 Jun 2013 11:21:04 PM UTC, comment #2: 

Ben,

I sent you an email about the fact that this changeset
introduces a regression with respect to subplots.
I looked at the changeset, but could not find where it
causes the size of a subplot to go wrong.

Anyhow, if I rollback this changeset the problem goes away.

I hope you can find the problem since this changeset also
does a lot of good!

Michael

Michael Godfrey <godfrey>
Group Member
Mon 24 Jun 2013 06:58:22 AM UTC, comment #1: 
Ben Abbott <bpabbott>
Group Member
Sun 23 Jun 2013 11:14:05 AM UTC, original submission:  

The frontend doesn't initialize the "tightinset" correctly.


figure (1, '__graphics_toolkit__', 'fltk')
clf ()
plot (rand (3))
set (findall (gcf (), '-property', 'fontsize'), 'fontsize', 10)
tightinset = get (gca (), 'tightinset');
position = get (gca (), 'position');
outerposition = get (gca (), 'outerposition');
looseinset = get (gca (), 'looseinset');

matlab_looseinset = [0.13, 0.11, 0.095, 0.075];
matlab_tightinset = [0.0393, 0.0381, 0.0089, 0.0190];
matlab_position = [0.13, 0.11, 0.775, 0.815];
matlab_outerposition = [0, 0, 1, 1];

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))


Running the script above, produces the result below.


Matlab "position"      = [0.13000, 0.11000, 0.77500, 0.81500]
Octave "position"      = [0.13000, 0.11000, 0.77500, 0.81500]
Matlab "outerposition" = [0.00000, 0.00000, 1.00000, 1.00000]
Octave "outerposition" = [0.00000, 0.00000, 1.00000, 1.00000]
Matlab "tightinset"    = [0.03930, 0.03810, 0.00890, 0.01900]
Octave "tightinset"    = [0.13000, 0.11000, 0.09500, 0.07500]
Matlab "looseinset"    = [0.13000, 0.11000, 0.09500, 0.07500]
Octave "looseinset"    = [0.13000, 0.11000, 0.09500, 0.07500]


The tight inset should be set equal to the difference between the axes bounding box (including the title, {x,y,z}labels and {x,y,z}ticklabels) and the axes "position" (which is just the bounding box for the axes' plot area).  See the link below for more information.

http://www.mathworks.com/help/matlab/creating_plots/automatic-axes-resize.html

The "looseinset" is an undocumented Matlab property.  There is some info on it from non-mathworks sources.

http://undocumentedmatlab.com/blog/axes-looseinset-property/

(Note: This bug/feature prevents legend() from consistently rendering a proper result)

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 #28673:  changeset.patch added by bpabbott (1KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by godfrey (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-07-28 bpabbott StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2013-07-27 bpabbott Attached File- Added changeset.patch, #28673
        StatusReady For Test Patch Submitted
    2013-06-24 bpabbott StatusNone Ready For Test
        Assigned toNone bpabbott

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code