Plot five y axis for one x axis in single plot?

조회 수: 2 (최근 30일)
Willian Alexander Correa Reyes
Willian Alexander Correa Reyes 2022년 11월 15일
편집: RAGHUNATHRAJU DASHARATHA 2022년 11월 15일
I am trying to plot with 5 variables on five different y axis vs a time variable on the x axis. But I don't know where I have the error. If you could help me I would be very grateful. My code is:
T1 = readtable('plot.csv', 'VariableNamingRule','preserve')
MyDateTime = T1.Date + T1.Time;
MyDateTime.Format = 'yyyy-MM-dd HH:mm:ss';
T2 = [T1(:,1) table(MyDateTime) T1(:,[3:end]) T1(:,[4:end]) T1(:,[5:end]) T1(:,[6:end]) T1(:,[7:end])]
figure
plot(T2.MyDateTime, T2.('Millitm'), T2.('{MB-24.FLO2.PT-34}', T2.('{MF-20.FLO2.TIT-42}', T2.('{MF-24.FLOS2.PD-5422}'), T2.('{MF-24.FLOS2.PD-5422}'), '-r', 'LineWidth',1)
grid
xlabel('Date & Time')
ylabel('Variable 1')
ylabel('Variable 2')
ylabel('Variable 3')
ylabel('Variable 4')
ylabel('Variable 5')
title('\ "n" variable function of time')
For example, like this

답변 (1개)

RAGHUNATHRAJU DASHARATHA
RAGHUNATHRAJU DASHARATHA 2022년 11월 15일
편집: RAGHUNATHRAJU DASHARATHA 2022년 11월 15일
As per my understanding you want to plot multiple y-axis for single x-axis in a plot
You can try a function from the file exchange
you can also go through this link to know more in detail.

카테고리

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