image thumbnail


version (1.85 KB) by Andreas
Shades areas between a curve and a fixed threshold.


Updated 25 Mar 2005

View License

Editor's Note: This file was a File Exchange Pick of the Week

AREASHADE(X,Y,F) shades the area where Y is larger than some fixed value F using the color yellow.

AREASHADE(X,Y,F,C) uses color C instead of yellow.

AREASHADE(X,Y,F,C,TH) where TH = 'h' uses F as a high threshold and shades the are where Y<F. Default for TH is 'l', painting Y>F.

H = AREASHADE(X,Y,F) returns a handle to the created patch.

x = [0:.5:20]; y = sin(x);
figure, plot(x,y,'o-'), hold on
plot(xlim,1/sqrt(2)*[1 1],'k')
plot(xlim,-1/sqrt(2)*[1 1],'k')

Cite As

Andreas (2021). AREASHADE (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!