How the property 'textstep' modify my contour graph?

I would like to know how change my contour graph if I modify de property 'textstep'. I don't understand the description "interval between labeled contour lines, specified as a scalar numeric value¨".
Thanks

답변 (1개)

Adam Danz
Adam Danz 2020년 5월 1일
편집: Adam Danz 2020년 5월 4일
TextStep controls which contours are labeled.
Consider this example.
% produce contour plot example.
x = -2:0.2:2;
y = -2:0.2:3;
[X,Y] = meshgrid(x,y);
Z = X.*exp(-X.^2-Y.^2);
[~, C] = contour(X,Y,Z,'ShowText','on');
Note that the contour labels are [.1, .2, .3, ...] (image below, left)
Look at the current TextStep value.
>> C.TextStep
ans =
0.1
>>
Double the value
C.TextStep = 0.2
Note the change in text labels. (image below, right)
A common approach is to set TextStep as a factor of LevelStep.
C.TextStep = C.LevelStep*2;

댓글 수: 1

This doesn't work in my case. I specified the level in the contourf function

댓글을 달려면 로그인하십시오.

카테고리

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

질문:

2020년 5월 1일

댓글:

2023년 2월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by