"Andrea " <email@example.com> wrote in message <firstname.lastname@example.org>... > "Nabanita " <email@example.com> wrote in message <firstname.lastname@example.org>... > > Hi, > > I think this works. > > y = [0:0.2:10]; > > x1 = y.^2+2; > > x2 = 3*y-3; > > % The variable with higher y value should be plotted first. For more complex situation plot all the > > % curves first to check which one has higher y values > > figure > > h2 = area(x2,y,'FaceColor',[.5 .9 .6],'EdgeColor','b', 'LineWidth',2); > > % plot the x2 and x1 variables. x2 variable is marked by blue line > > hold on > > h1 = area(x1,y,'FaceColor',[.9 .85 .7],'EdgeColor','y','LineWidth',2); > > hold off > > % The area between x2 and x1 variable is shaded green and the area between > > % x =0 and x1 variable is shaded brown. > > % The problem with this code is that you can set any transparency because > > % it is actually shading the area between x2 and x =0 and then x1 and x = 0. > > > > Nita > > JS <email@example.com> wrote in message <firstname.lastname@example.org>... > > > > > > Hi Group, > > > > > > I am also having this problem/challenge: > > > > > > On Sep 26, 5:57?pm, "owen o'sullivan" <om...@fsu.edu> wrote: > > > > I am trying to fill/shade the area between several groups of two lines on a time series graph. I am Using MatLab 7.7.0 (R2008b). Can anyone please help. > > > > Owen > > > > > > It must be possible. I've tried plotting two area() graphs in the same > > > axis and coloring the face of the lower one white, but it doesn't look > > > good and it is a hack.. Anybody have any ideas? > > > > > > Thanks! > > > > > > /J > > > I have kind of the same problem and could not get to a solution yet. > I have two vectors with min and max values of a data set, I would like to show the variance by shading these interval. (also plotting the mean). > > This message is always occurring : > > >>Subscript indices must either be real positive integers or logicals. > > When I tried fill() or area() ... and tried also this code: > > http://stackoverflow.com/questions/6245626/matlab-filling-in-the-area-between-two-sets-of-data-lines-in-one-figure > ...where it does not like the baseLine function ... > > Can anyone give a solution to fill the area within the curves?!
% Have you tried:
% It seems to be exactly the command you are looking for. % Lookl at the Examples section in the help.