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

14 views (last 30 days)
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

Answers (1)

drummer
drummer on 16 Jun 2020
what about this one?
  1 Comment
Riadh Dhaoui
Riadh Dhaoui on 16 Jun 2020
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');

Sign in to comment.

Categories

Find more on Graphics Object Identification in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!