请问怎样将一幅图的图例legend复制到另一幅图中?
如题,谢谢 1# guohf代码如下:
clear;clc;close all
h1 = figure(1);
fplot(@sin,[-1,1]);
legend('y=sin(x)');
h1_o = findobj(h1,'Tag','legend');
h2=figure(2);
fplot(@cos,[-1,1]);
h2_n=copyobj(h1_o,h2);
cc=get(h2_n,'String');
set(h2,'Tag',cc{:});
页:
[1]