3 subplots of those three intervals in a horizontal line

24 次查看(过去 30 天)
clear;
clc;
X = readtable('FinalProj_TVdata.csv');
Y = readtable('FinalProj_Pdata.csv');
%Convert from Fahrenheit to Kelvin
TempK = ((X{:,1}-32)*5/9)+273.15;
time = 1:300;
%Temperature vs time graph 1
figure(1)
plot(TempK,time);
title('Temperature vs Time')
xlabel('Temperature(Kelvin)')
ylabel('Time(days)')
%Defining symbols for different intervals
t1 = 1:100;
t2 = 101:200;
t3 = 201:300;
A = TempK(1:100);
B = TempK(101:200);
C = TempK(201:300);
%Graph 2 of intervals
figure(2)
plot(A,t1)
hold on
plot(B,t2)
plot(C,t3)
hold off
title('Temperature vs Time intervals')
xlabel('Temperature(Kelvin)')
ylabel('Time(days)')
legend({'y = t1','y = t2', 'y = t3'},'Location','northeast')
I am trying to graph the 3 sub intervals into a horizontal line. Can anyone please help me with that? Thank you!

回答(1 个)

Akihumi
Akihumi 2020-5-9
Do you mean using something like subplot?
Eg:
figure
subplot(1,3,1)
plot(x,A)
subplot(1,3,2)
plot(x,B)
subplot(1,3,3)
plot(x,C)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by