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

2 visualizaciones (últimos 30 días)
Willian Alexander Correa Reyes
Willian Alexander Correa Reyes el 15 de Nov. de 2022
Editada: RAGHUNATHRAJU DASHARATHA el 15 de Nov. de 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

Respuestas (1)

RAGHUNATHRAJU DASHARATHA
RAGHUNATHRAJU DASHARATHA el 15 de Nov. de 2022
Editada: RAGHUNATHRAJU DASHARATHA el 15 de Nov. de 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
you can also go through this link to know more in detail.

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by