Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to plot figure from a stored file?

1 回表示 (過去 30 日間)
ramya
ramya 2018 年 4 月 29 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I have 3 different codes with me...and with each code i got accuracy results graph....nw plz suggest me what i should do to combine all three graphs in single figure window .....? Suggest some technique

回答 (1 件)

Alfonso
Alfonso 2018 年 4 月 29 日
In order to combine the three graphs in a unique figure you could use subplot.
figure
% First set of data
subplot(1,3,1)
plot(x_graph1, y_graph1, 'color', 'b')
title('Data of code 1')
% Second set of data
subplot(1,3,2)
plot(x_graph2, y_graph2, 'color', 'r')
title('Data of code 2')
% Third set of data
subplot(1,3,3)
plot(x_graph3, y_graph3, 'color', 'g')
title('Data of code 3')
Or if you just want the three data sets in a unique graph you could just:
figure
plot(x_graph1, y_graph1, 'color', 'b')
hold on
plot(x_graph2, y_graph2, 'color', 'r')
hold on
plot(x_graph3, y_graph3, 'color', 'g')
  2 件のコメント
ramya
ramya 2018 年 4 月 30 日
編集済み: ramya 2018 年 4 月 30 日
i have accuracy results in 3 different files ..how to read from that file then load it and then finally combine all three results graph in one figure window.
Alfonso
Alfonso 2018 年 4 月 30 日
編集済み: Alfonso 2018 年 4 月 30 日
To load the saved data sets in your workspace you should:
data1=load('filename1.mat');
data2=load('filename2.mat');
data3=load('filename3.mat');
Then execute the code I suggested but changing the x_graph to data(:,1) and y_graph to data(:,2) for each data set plot. e.g.
figure
plot(data1(:,1),data1(:,2),'r')
hold on
plot(data2(:,1),data2(:,2),'b')
hold on
plot(data3(:,1),data3(:,2),'g')
title('Results of 3 datasets')

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by