How can I add 3D labeled contours to a surface plot?

How can I add 3D labeled contours to a surface plot?

 Accepted Answer

The functions 'surf', 'contour3', and 'clabel' can be used together to produce an elegant plot. The example below demonstrates how:
>> figureHandle = figure;
>> axesHandle = axes(figureHandle);
>> hold on
>> surfaceHandle = surf(axesHandle, peaks,'linestyle','none','FaceAlpha',0.7);
>> [contourMatrix, contourHandle] = contour3(axesHandle, peaks,'k');
>> hold off
>> clabel(contourMatrix, contourHandle)

More Answers (0)

Categories

Products

Release

R2018a

Community Treasure Hunt

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

Start Hunting!