Plotting of 15 years data on same graph.
Mostrar comentarios más antiguos
I have data of 15 years as i have attached here, which has the format as: Date, time, Pressure data, Temperature Data.
I want to plot the temperature dataset year over year, lets say on x-axis january-december is labeled i want to plot each year data (just Temperature) with different colored plots on the same graph.
Thanks in advance
2 comentarios
Raj
el 11 de Dic. de 2019
There is no attachment..
Zunaira Akmal
el 11 de Dic. de 2019
Respuesta aceptada
Más respuestas (1)
Hiro Yoshino
el 11 de Dic. de 2019
0 votos
Convert the date information to datetime type and extract just "months" and "days" using the functions, "month" and "day".
This way, you can remove "year" information from your dataset and thus you can line them up in the same x-axis.
6 comentarios
Zunaira Akmal
el 11 de Dic. de 2019
Hiro Yoshino
el 11 de Dic. de 2019
I cannot tell what you mean since you haven't uploaded your data though, I guess you should have all the data as a table variable and
monthdata = month(your_table.Date)
daydata = day(your_table.Date)
new_timedata = datetime(monthdata,daydata) % Not sure if this line works
your_table.Date = new_timedata; % Update your table
This is a rough idea but I belive this is good enough for you to move forward. :-)
Zunaira Akmal
el 11 de Dic. de 2019
Zunaira Akmal
el 11 de Dic. de 2019
dpb
el 11 de Dic. de 2019
Use the new_timedata vector as x, the array of data by column as y and plot will automagically do the rest...
Have you tried anything? This is a cooperative venture, show us what you have done.
Zunaira Akmal
el 11 de Dic. de 2019
Editada: per isakson
el 13 de Dic. de 2019
Categorías
Más información sobre Calendar en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
