Plotting a time series with shaded regions
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hi I want plot a time series (see below) with shade strips in the background. For example, if the data belongs to 1998, add a light grey strip behind the line. If it belongs to 1999, add a darker grey stripe behind the line and so on. I would also like to have a text box on each strip indicating the period of time. It seems to be a very challenging task for me. can someone help me?
thanks very much.
'6/01/1998' [ 5.41]
'9/01/1998' [5.0933]
'12/01/1998' [ 4.39]
'3/01/1999' [4.6633]
'6/01/1999' [ 4.88]
'9/01/1999' [ 5.16]
'12/01/1999' [5.6067]
'3/01/2000' [6.1867]
'6/01/2000' [6.2167]
'9/01/2000' [ 6.13]
'12/01/2000' [ 5.9]
'3/01/2001' [4.5967]
'6/01/2001' [ 3.78]
0 Commenti
Risposte (1)
Yao Li
il 16 Mag 2014
time='6/01/1998';
fwd_slash_loc=strfind(time,'/');
year=time(fwd_slash_loc(2)+1:end);
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!