How can I add time labels to the x-axis of my plot?

4 vues (au cours des 30 derniers jours)
poshan reddy
poshan reddy le 16 Avr 2014
Commenté : poshan reddy le 28 Avr 2014
sample data .if i have data like this how to plot with exact date and time
with seconds give me a program
31/08/97 03:03:32
31/08/97 03:07:39
31/08/97 03:10:46
31/08/97 03:15:46
31/08/97 03:26:59
31/08/97 03:28:00
31/08/97 03:42:56
31/08/97 03:54:23
31/08/97 03:56:57
31/08/97 04:07:00
31/08/97 04:47:51
31/08/97 22:07:59
  1 commentaire
dpb
dpb le 16 Avr 2014
Modifié(e) : dpb le 16 Avr 2014
See
doc datenum
doc datetick
and examples thereat
ADDENDUM:
OK at machine w/ a minute...try
>> dn=datenum(datevec(t,'dd/mm/yy HH:MM:SS')); >> plot(dn,rand(size(dn))) >> datetick('x','keeplimits','keepticks')
NB: I cleaned up the above data strings that had tab here and there down to a single space; use format as needed for the actual form.

Connectez-vous pour commenter.

Réponses (1)

Ralf
Ralf le 16 Avr 2014
I hope it is clear now:
DateTime{1,1} = '31/08/97 03:03:32'; %
DateTime{1,2} = '31/08/97 03:07:39'; %
Yvalue = [3 4]; % Example values
ts1 = timeseries(Yvalue,DateTime); % Create a timeseries object whit oure yvalue %and the time scale
ts1.Name = 'Warming up off ... '; % Give it a name
plot(ts1); % Create a plot of it.
grid ('on');

Catégories

En savoir plus sur Graphics Object Programming dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by