Plot five y axis for one x axis in single plot?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Willian Alexander Correa Reyes
am 15 Nov. 2022
Bearbeitet: RAGHUNATHRAJU DASHARATHA
am 15 Nov. 2022
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1193443/image.png)
0 Kommentare
Antworten (1)
RAGHUNATHRAJU DASHARATHA
am 15 Nov. 2022
Bearbeitet: RAGHUNATHRAJU DASHARATHA
am 15 Nov. 2022
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 Kommentare
Siehe auch
Kategorien
Mehr zu Line Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!