Code covered by the BSD License  

Highlights from
Shaded time series

5.0

5.0 | 1 rating Rate this file 15 Downloads (last 30 days) File Size: 2.88 KB File ID: #20625
image thumbnail

Shaded time series

by Carl Fischer

 

09 Jul 2008 (Updated 08 Mar 2011)

Plot time series one above the other with coloured strips highlighting interesting features.

| Watch this File

File Information
Description

Use this function to plot several time series aligned beneath each other with shaded blocks highlighting important sections.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
ShadePlotForEmphasis

MATLAB release MATLAB 7.10 (2010a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
22 Jul 2009 Shlomi

if the indicator is a row vector the function doesn't work properly. I added the simple command of indicator = indicator(:); in my code. You should add it too

23 Sep 2009 Carl Fischer

Thanks for the suggestion Shlomi. I've submitted an update but I also added some extra sanity checks to ensure sizes are consistent.

21 Jun 2010 Kuo-Hsien

Hi Carl, this is a useful function. How to show the box for subplots and legend? thx.

22 Jun 2010 Carl Fischer

Thanks for the feedback. Not sure what you mean about subplots.
If you just want to display the part of the legend that shows the shaded colour then you can add legend('Interesting bit'); after this function. I feel that anything more sophisticated will be difficult to generalise and may be quite specific to your particular problem. It might be easier if you tweak the function yourself.

07 Sep 2010 Carl Fischer

I uploaded a new version which allows you run this function with only one column of data to populate your own subplots (instead of creating a new figure). Not sure if that's what Kuo-Hsien was requesting. See the examples in the documentation to see how this works.

Please login to add a comment or rating.
Updates
23 Sep 2009

Allow data in rows or columns. Extra sanity checks on data lengths.

23 Sep 2009

Fixed bug that occurred when X was a row vector.

15 Jul 2010

Detect inconsistent data lengths.

06 Sep 2010

Accept different indicators to shade each subplot differently.
If the user specifies a single column of data then use the current plot instead of creating a new one to allow the user more control (eg. custom subplots).

08 Mar 2011

Slight improvement to parameter consistency checks.

Tag Activity for this File
Tag Applied By Date/Time
annotation Carl Fischer 22 Oct 2008 10:09:33
customization Carl Fischer 22 Oct 2008 10:09:33
highlight Carl Fischer 22 Oct 2008 10:09:34
graphics Carl Fischer 22 Oct 2008 10:09:34
subplots Carl Fischer 22 Oct 2008 10:09:34
time Carl Fischer 22 Oct 2008 10:09:34
shading Gautam Vallabha 17 Jun 2009 11:15:23

Contact us at files@mathworks.com