octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #39395] legend spacing ignores fontsize


From: Ben Abbott
Subject: [Octave-bug-tracker] [bug #39395] legend spacing ignores fontsize
Date: Tue, 02 Jul 2013 09:45:51 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?39395>

                 Summary: legend spacing ignores fontsize
                 Project: GNU Octave
            Submitted by: bpabbott
            Submitted on: Tue 02 Jul 2013 05:45:50 AM EDT
                Category: Plotting
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Inaccurate Result
                  Status: None
             Assigned to: None
         Originator Name: Ben Abbott
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

The 1st demo for legend.m is


clf;
 plot (rand (2));
 title ('legend called with cellstr and string inputs for labels');
 h = legend ({'foo'}, 'bar');
 legend location northeastoutside
 set (h, 'fontsize', 20);


The resulting fontsize is correct for both the gnuplot and fltk toolkits, but
the line spacing between the legend's keys does not change.  The result is
that the keys are too close together.

To fix this the entire legend must be reconstructed.  Unfortunately, if the
fontsize listener is modified to @updatelegend the key objects are deleted and
replace by new ones.  This introduces problems for the print command which
attempt to temporarily modified the fontsize of all objects.  Which is a
problem if the same objects do not exist when print() attempt to return the
fontsizes to their original values.

Also, replace key objects is inconsistent with Matlab, as is demonstrated
below.


close all
plot (rand (3))
hl = legend ({'blue', 'green', 'red'});
userdata = get (hl, 'UserData')

userdata = 

        PlotHandle: 173.1833
         legendpos: 1
    LegendPosition: [0.7406 0.7786 0.1562 0.1292]
      LabelHandles: [9x1 double]
           handles: [3x1 double]
          lstrings: {3x1 cell}
      LegendHandle: 181.1833

set (hl, 'fontsize', 20)
userdata2 = get (hl, 'UserData');
isequal (userdata.LabelHandles, userdata2.LabelHandles)

ans = 1


A rewrite of legend() looks to be needed.  In doing so, it wouldn't hurt to
copy the info Mathworks saves to the legend's userdata property.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39395>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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