When the root ‘ShowHiddenHandles’ option is set ‘on’, a text object tagged as 'temphackytext' associated with a figure legend is not automatically deleted in MATLAB 7.11 (R2010b)?

6 views (last 30 days)
I set the root ‘ShowHiddenHandles’ option to ‘on’ and create a legend in the current axes. I see an extra text object tagged as 'temphackytext' in the 'children' associated with the legend object.
Reproduction steps:
set(0,'showhiddenhandles','on');
plot(1:10,rand(1,10));
L=legend('test');
H=findobj(L,'type','text');
disp(get(H,'tag'));

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 14 Feb 2011
The second text object is a dummy text object used by the legend to compute spacing. A work around is to manually delete the text object "temphackytext" when the legend creation is complete.
set(0,'showhiddenhandles','on');
plot(1:10,rand(1,10));
L=legend('test');
H=findobj(L,'type','text');
delete(H(strcmp(get(H,'tag'),'temphackytext'))); % Delete the object tagged as 'temphackytext'
H_new=findobj(L,'type','text');
disp(get(H_new,'tag'));

More Answers (0)

Products


Release

R2010b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!