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

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

[Octave-bug-tracker] [bug #52641] Changing legend "displayname" property


From: Rik
Subject: [Octave-bug-tracker] [bug #52641] Changing legend "displayname" property to empty string "" leads to printing an error
Date: Tue, 12 Dec 2017 12:11:02 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Update of bug #52641 (project octave):

                  Status:                   Fixed => In Progress            
             Open/Closed:                  Closed => Open                   

    _______________________________________________________

Follow-up Comment #7:

@Dan: I don't think it makes sense to add a new function updatename.  The
function updateline is the callback for all line objects which have a legend. 
Although we don't have it implemented, there should be callbacks for patch and
surface objects as well.  Logically, those callbacks should be called
updatepatch and updatesurface and they will contain the segregated code for
dealing with each of those objects respectively.  Dividing by property, such
as "color" or "name" would also have been a possibility, but this would have
required a lot of callbacks since a line object has 8 properties and the other
objects might have added even more.  Instead, we only require 3 callbacks--one
per object type.

The performance issue is that recursion should be stopped.  Unfortunately
moving the code for updating the strings to its own callback will not prevent
that.  It would be possible to use a global variable, or the "userdata"
property of the legend object itself, as an out-of-band communication method.

I am very reluctant to change __getlegenddata__ because it is used in more
routines than just legend.m, and the legend code itself is very complicated
with potential for unexpected side effects.

It seems that there is another in-band/out-of-band communication problem.  How
is Octave supposed to distinguish between an object which has never been
labeled, for which DisplayName is "", and an object for which the label is
desired to be blank?  One possibility is to change labels that are explicitly
set to "" to contain one space, " ".  I think we need some testing from
someone with access to Matlab.

What does this code do?


close all
h = plot (1:10, 'o-')
legend ('abc')
set (h, 'displayname', '')
% Does legend disappear?
double (get (h, 'displayname'))


I've asked on the mailing list about this.

I've also re-opened this bug report.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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