FUNCTION REFERENCE
contourf
Filled contour plot.
Filled contour plot.
Syntax
contourf(Z)Syntax
contourf(X, Y, Z)Syntax
contourf(..., n)Syntax
contourf(..., v)Syntax
contourf(..., LineSpec)Syntax
contourf(..., Name, Value)Syntax
[C, h] = contourf(...)Same inputs, options and handle properties as contour, with the regions between levels filled: the band from one level up to the next has the colormap colour of the lower level. Levels as in GNU Octave: a count n (default 10) gives min(Z(:)) followed by contourc's n levels, so h.LevelList has n+1 entries, CLim is [min(Z) highest level] and the band from the minimum up to the first line gets the first colormap row, every other band its own colour; min(Z) never has a line, so C is contourc's. A vector v gives v's levels only: CLim spans them and the region below the first level stays unfilled. The bands are built cell by cell (whole cells as rectangles, cut cells as triangles; saddle cells split at the centre average) and the contour lines are drawn on top in black; 'LineColor', 'none' hides them. NaN cells stay empty. h.Fill is 'on'.
Example
[C, h] = contourf(peaks(20), 5); h.Fill % 'on'Example
[~, h] = contourf(magic(4), 2); h.LevelList % [1 6 11]Example
contourf(peaks(20), 'LineColor', 'none'); colorbar;Example
contourf(peaks(20), 'EdgeColor', 'none', 'FaceAlpha', 0.8);Differences from MATLAB: the band faces share the figure's patch budget of 100000 faces, so large grids with many levels report an error (use a coarser grid or fewer levels). The same limits and .mrfig behaviour as contour apply.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.