How do you make an area plot without rounding to box in the entire figure.

2 views (last 30 days)
area(hflux(:,550), yy(:,1,1));
So I made an area plot where the lines are supposed to have shaded area below it. However, this function seems to connect the squiggly lines into a rectangular shape. Is there another function that could graph something like a line plot but with shaded area only below it?

Answers (1)

Walter Roberson
Walter Roberson on 6 Aug 2015
You will need to decide on a lower bound for "below".
Example:
baseline = -1;
a = rand(1,30);
fill([1:length(a), length(a), 1], [a,baseline,baseline], 'r')
that is, run along top of "a", then at the last point drop down to the baseline, run straight back from there to under the first point, and let fill automatically close from there to (1,a(1))

Categories

Find more on Line Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!