legend is not copied in figure editor
2 ビュー (過去 30 日間)
古いコメントを表示
I want to copy figure1(red line) on figure2(blue line).
So I copied red line and pastsed figure2.
But only red line is copied on figure2 without legend about figure1.
As I know, normally, legend about figure1 is copied with red line.
If you help me, I really appreciate that!
j![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1383714/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1383714/image.png)
0 件のコメント
回答 (1 件)
chicken vector
2023 年 5 月 15 日
編集済み: chicken vector
2023 年 5 月 15 日
I suggest you to do this programmatically.
You can load your two figures with:
f = openfig('filepath');
and merge them with the following:
N = 10;
x = 1:N;
y1 = x;
y2 = x.^2/4;
f1 = figure;
plot(x,y1,'b');
legend('Curve 1');
f2 = figure;
plot(x,y2,'r');
legend('Curve 2');
lines = findobj('Type','Line');
figure;
copyobj(lines,gca);
legend;
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Legend についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!