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

2 次查看(过去 30 天)
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
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