Plot AREA limit in matlab

4 views (last 30 days)
Giovanni Gardan
Giovanni Gardan on 6 Aug 2020
Answered: Star Strider on 6 Aug 2020
I have two vectors (n and abb_per) and I'd like to make an area plot. I'd like to make the upper limit of the graphic as 100 (and not the bigger number of abb_per).
I tried to use the command axis but doesn't work. How could I do?
n = [18 19 39 60 130 797 2060];
ren = [0.081423 0.098465 0.09714 0.139722 0.174535 1.196584 2.731867];
gar = [0.03305 0.034039 0.033889 0.040322 0.032641 0.13198 1.0767];
abb_per = ((ren-gar)./ren)'*100;
area(n,abb_per)
axis[(0 2060 0 100)]

Accepted Answer

Star Strider
Star Strider on 6 Aug 2020
If you want the area between ‘abb_per’ and 100 filled, use the patch function.
Try this:
figure
patch([n fliplr(n)],[abb_per; ones(size(abb_per))*100].','b')
producing:
.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!