Matlab 2014b: Copying just the legend from existing figure into subplot
Ältere Kommentare anzeigen
Hi there,
I'm looking for how to get the legend from an existing saved figure and load it as the legend in a figure of subplots.
In 2013 I used to be able to do:
h1 = hgload('file.fig');
leg_ax = findobj(h1,'type','axes','Tag','legend','-not','Tag','Colorbar');
s6 = subplot(2,3,3);
copyobj(leg_ax,get(s6,'Parent'));
Thanks, Ashley
Akzeptierte Antwort
Weitere Antworten (1)
Azzi Abdelmalek
am 19 Nov. 2014
h1 = hgload('file.fig');
leg_ax = findobj(h1,'type','axes','Tag','legend','-not','Tag','Colorbar');
figure
s6 = subplot(2,3,3);
copyobj(leg_ax,get(s6,'Parent'));
2 Kommentare
Ashley Penna
am 19 Nov. 2014
Azzi Abdelmalek
am 19 Nov. 2014
The handles can not be used if the object is deleted
Kategorien
Mehr zu Legend finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!