contourfill

Fills area between TWO contour levels.
514 Downloads
Updated 1 Apr 2013

View License

The procedure sews together neighboring contour paths, and draws resulting polygon with holes in it. The paths are extracted from 'children' property of standard contourf object, because they are closed, unlike the 'contour matrix'.
If you desire 'edgecolor' other than 'none', please use standard contour procedure.

Usage:
[poly ph] = contourfill(x,y, z, lev, varargin)

poly = cell array with x,y-coordinates of the closed-contour-paths
ph = handles to plot objects created by function fill
Other arguments refer to 'fill'.
Example:
lev = [0.5 2];
z = peaks(100);
figure(234); clf; hold on;
contourfill([],[], z' , lev, facecolor', 'b', 'facealpha', 0.3 );
contourfill([],[], flipud(z), lev, 'facecolor', 'g', 'facealpha', 0.3 );
contourfill([],[], fliplr(z), lev, 'facecolor', 'r', 'facealpha', 0.3 );

Cite As

Lukas Chvatal (2024). contourfill (https://www.mathworks.com/matlabcentral/fileexchange/41018-contourfill), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Contour Plots in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.3.0.0

just a typo in description corrected

1.0.0.0