%% Change Location of Contour Lines
% The contour lines appear at the minimum z-level by default, but you can change the location by setting the ZLocation property.
% Display the peaks data set as a mesh plot with the contours at the minimum z-level. Specify a return argument when you call the meshc function so that you can access the Contour object.

Z = peaks;
sc = meshc(Z);

%
% Get the current axes and extend the upper limit of the z-axis to 15. Then move the contours to the maximum z-level.

ax = gca;
ax.ZLim(2) = 15;
sc(2).ZLocation = 'zmax';

% Copyright 2020 The MathWorks, Inc.