File Exchange

image thumbnail

AREASHADE

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

1 Download

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.

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

Cite As

Andreas (2020). AREASHADE (https://www.mathworks.com/matlabcentral/fileexchange/7255-areashade), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (5)

An excellent work indeed

Jagadeesh

WoW, this is really superb.And, Andreas have you ever tried transparent plot i.e the plot which is behind is overlapped with the plot at the front and should be visible to the user

Ajaya Mohan

Excellent, solved my long standing problem.

ff frfr

eric campos

e estado buscando la forma de encontrar el area de una grafica yo tambien y encontre la tuya y la voy a estudiar

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