Labeling only specific contour lines in a contour plot

I have a contour plot with many lines. However, I want to label only some of those lines. How do I do this?

 채택된 답변

MathWorks Support Team
MathWorks Support Team 2016년 12월 16일
For labeling only some of the lines in a contour plot, define a vector with the lines you want to label, and give that as an input argument to the "clabel" function. 
As an example : 
 
% Generate labels only for contour lines 2 and 6
[x,y,z] = peaks;
[C,h] = contour(x,y,z);
v = [2,6];
clabel(C,h,v);

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Contour Plots에 대해 자세히 알아보기

제품

릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by