How to add the year to the stairs plot

2 visualizaciones (últimos 30 días)
Sewwandhi Chandrasekara
Sewwandhi Chandrasekara el 22 de Jun. de 2020
Respondida: dpb el 22 de Jun. de 2020
I have temperature data sets starting from 1968 to 2019 and in some stations the starting year change such as 1988, 1973 etc. I want to plot the data with the years in x axis.
title('Distribution of temperature')
xlabel('Years') % x-axis label
ylabel('temperature') % y-axis label
xlim([1 52]); -----> in here I want to insert the time duration (1968 to 2019 or 1988 to 2019 or 1973 to 2019)
ylim([0 80]);
How can i do it?

Respuestas (1)

dpb
dpb el 22 de Jun. de 2020
Use a datetime for your time variable and you'll get time plots automagically along the x axis and can set xlim() values with dates as desired.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by