5.0

5.0 | 1 rating Rate this file 9 Downloads (last 30 days) File Size: 2.1 KB File ID: #41018
image thumbnail

contourfill

by

 

29 Mar 2013 (Updated )

Fills area between TWO contour levels.

| Watch this File

File Information
Description

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 );

Required Products MATLAB
MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
28 Apr 2013 JR King

Cool function thanks. It'd be great to add an option for controlling the colors when using multiple levels.

Updates
01 Apr 2013

just a typo in description corrected

Contact us