How to plot multiple figures (.fig) into one figure?

Dear member of the community,
I am new to MATLAB and need your assistant.
I have several .fig files. Is it possible to somehow take the actions of the individual characters and then make them into a plot?
I would like to point out the differences between these "curve fits". For example: path_ground.fig path_gmapping.fig
I have tried Servel attempts (like https://de.mathworks.com/matlabcentral/answers/333909-how-to-plot-multiple-figures-fig-into-one-figure), but without success.
Your help will be greatly appreciated.
I thank you in advance

回答(1 个)

what about this one?

1 个评论

Thank you Not bad, but here the right solution
clear;
close all;
clc;
f = openfig('test1.fig');
H = findobj(gca,'Type','line');
x_data = cell2mat(get(H,'xdata'));
y_data = cell2mat(get(H,'ydata'));
%close(f)
g = openfig('test2.fig');
G = findobj(gca,'Type','line');
x1_data = cell2mat(get(G,'xdata'));
y1_data = cell2mat(get(G,'ydata'));
%close(g)
t = openfig('gmapping.fig');
T = findobj(gca,'Type','line');
x2_data = cell2mat(get(T,'xdata'));
y2_data = cell2mat(get(T,'ydata'));
figure
scatter(x_data,y_data,'r','.');
hold on
scatter(x1_data,y1_data,'g','.');
hold on
scatter(x2_data,y2_data,'k','.');
xlabel('x');
ylabel('y');

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by