How to set x axis into hours
Mostrar comentarios más antiguos
I have energy consumption data of more than 3 years for every two seconds (43200 per day). Different households. How do I set the x axis into 24hrs (00:00 - 23:59) and plot each day data on one graph?
Thanks
Respuestas (1)
Sean de Wolski
el 23 de Feb. de 2015
Something along these lines (R2014b required)
dt = datetime('now')-100:1/24:datetime('now');
hours = hour(dt);
scatter(hours,rand(size(dt)));
ax = gca;
ax.XTick = 1:24;
ax.XTickLabelRotation = -60;
4 comentarios
ccs
el 23 de Feb. de 2015
Sean de Wolski
el 23 de Feb. de 2015
doc datetime
ccs
el 26 de Feb. de 2015
ccs
el 26 de Feb. de 2015
Categorías
Más información sobre Annotations 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!