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
0 个评论
回答(1 个)
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!