[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #41142] change to legend deletes and recreates
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #41142] change to legend deletes and recreates text objects |
Date: |
Wed, 08 Jan 2014 02:49:10 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0 |
Follow-up Comment #1, bug #41142 (project octave):
Matlab's legend function is really hard to mimic exactly. As you know, we use
an axes object to represent the legend and the object has extra properties
beyond a regular axes object such as fontsize. We add listener's on the axes
object for these special properties so that if the legend object is changed
all of the child objects are updated. So, one way to make this work is just
to use this interface.
clf ()
plot (rand (2))
hleg = legend ({"foo", "bar"});
set (hleg, 'fontsize', 16);
The other way to get this to work is to sort handles so that the axes objects
are last.
set (h(! isaxes (h)), 'fontsize', 16)
set (h(isaxes (h)), 'fontsize', 16)
We currently destroy the legend axes object when the fontsize changes because
we need to re-calculate the size of the box which will fit the new text. If
you can see a better way then we can implement it, but it looks daunting.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?41142>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/