How do i superimpose different MATLAB figures
古いコメントを表示

Hi, i have these MATLAB figures and will like to superimpose them as one figure. Is there a line of code to achieve that? They both have same y and x limits
採用された回答
その他の回答 (3 件)
Kelechukwu Ezike
2018 年 3 月 1 日
0 投票
1 件のコメント
Walter Roberson
2018 年 3 月 1 日
first_fig = figure(1); %adjust as needed
second_fig = figure(2); %adjust as needed
third_fig = figure(3); %adjust as needed
first_ax = findobj(first_fig, 'type', 'axes');
second_ax = findobj(second_fig, 'type', 'axes');
third_ax = findobj(third_fig, 'type', 'axes');
if length(first_ax) ~= 1 || length(second_ax) ~= 1 || length(third_ax) ~= 1
error('this code requires the three figures to have exactly one axes each');
end
ch2 = get(second_ax, 'children'); %direct children only and don't try to find the hidden ones
copyobj(ch2, first_ax); %beam them over
ch3 = get(third_ax, 'children'); %direct children only and don't try to find the hidden ones
copyobj(ch3, first_ax); %beam them over
カテゴリ
ヘルプ センター および File Exchange で Graphics Object Properties についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!