Saving multiple figures of loop in one subplot

조회 수: 2 (최근 30일)
Ali
Ali 2019년 2월 18일
댓글: Ali 2019년 2월 18일
Is it possible to save figures of different loops in 1 sub plot?For example:there are 3 different training and testing datasets.I want to save the results of all three datasets in 1 subplot.Thank you.
Suppose dataset of 3 homes
data1 =Home 1;
date2=Home 2;
date3=Home 3;
i=data1+data2+data3;
for j=1:i
-----
end
% After training a model;
results_home1=actual Vs Predicted ; % suplot 1
results_home2=actual Vs Predicted ; % suplot 2
results_home3=actual Vs Predicted ; % suplot 3
% All the above suplots in 1 figure
  댓글 수: 2
Geoff Hayes
Geoff Hayes 2019년 2월 18일
Ali - do you want a subplot for each of the three data sets (results_home*), or one plot for all three? Please show us how you have generated the actual and predicted values for each dataset - do you call a function three times to generate this data, or something else?
Ali
Ali 2019년 2월 18일
I am using 3 datesets of 3 different home and after that i am using this example .I want to save every home results in 1 subplot.Example is attached in figure.figure.png
clc
clear
load HomeAmeter22016
load HomeBmeter12016
load HomeCmeter12016

댓글을 달려면 로그인하십시오.

채택된 답변

KSSV
KSSV 2019년 2월 18일
for i = 1:3
subplot(3,1,i)
plot(rand(10,1))
title(num2str(i))
end
  댓글 수: 1
Ali
Ali 2019년 2월 18일
@KSSV.....Thank you for this.I will try this.Besides ,i couldnt able to plot a time series data which shows cases on my Y-axis and moving time and date with x-axis.The sample of graph i want is attached.data (.xlsx) is also attached.I want to use coloumn 1 and coloumn 3 for plotting.sample_plot.png

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by