Help with legend

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with legend

Rik-4
Could someone run the following in Matlab and report on the results?

close all
h = plot (1:10, 'o-')
legend ('abc')
set (h, 'displayname', '')
% Does legend disappear?  Is label changed to a space, or a true null string?
double (get (h, 'displayname'))

Thanks,
Rik

Reply | Threaded
Open this post in threaded view
|

Re: Help with legend

Piotr Held
Hi Rick,

Matlab R2017a:
The label does disappear.
The value of displayname is:

>>get(h, 'displayname')
ans =
  0×0 empty char array

>> double (get (h, 'displayname'))
ans =
     []

Hope that helps.

Regards,

Piotr

On Tue, Dec 12, 2017 at 9:04 AM, Rik <[hidden email]> wrote:
Could someone run the following in Matlab and report on the results?

close all
h = plot (1:10, 'o-')
legend ('abc')
set (h, 'displayname', '')
% Does legend disappear?  Is label changed to a space, or a true null string?
double (get (h, 'displayname'))

Thanks,
Rik