| Graphics | ![]() |
Changing the Offset of a Contour
The surfc and meshc functions display contours beneath a surface or a mesh plot. These functions draw the contour plot at the axes' minimum z-axis limit. To specify your own offset, you must change the ZData values of the contour lines. First, save the handles of the graphics objects created by meshc or surfc.
h = meshc(peaks(20));
The first handle belongs to the mesh or surface. The remaining handles belong to the contours you want to change. To raise the contour plane, add 2 to the z coordinate of each contour line.
for i = 2:length(h);
newz = get(h(i),'Zdata') + 2;
set(h(i),'Zdata',newz)
end
| The Contouring Algorithm | Displaying Contours in Polar Coordinates | ![]() |