Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shading between vertical lines in MATLAB

Tags:

matlab

area

I'm sure this is a simple question, but I can't seem to figure it out. I've got this plot alt text

and I want to add vertical lines and shade the area in between to highlight areas of the data. I feel like I should be able to do this using the area function, but can't seem to figure it out. The dates and values are all doubles and are two separate vectors, if that makes a difference. Any help would be greatly appreciated.

like image 755
jefflovejapan Avatar asked Jan 15 '11 08:01

jefflovejapan


1 Answers

Very basic example about shading an area in a plot. Shading an area boundered by a curve might be of interest as well.

figure;
ha = area([4 6], [10 10]);
hold on
plot(1:10, 1:10,'r')
axis([1 10 1 10])
hold off

shaded area

like image 51
zellus Avatar answered Nov 05 '22 12:11

zellus