필터 지우기
필터 지우기

How to set the position of the label in a contour plot?

조회 수: 59 (최근 30일)
Genhou SUN
Genhou SUN 2019년 10월 19일
답변: Jelle Bakker 2023년 2월 16일
Dear all,
I need help in draw a contour plot. I got a contour plot using the following code:
[c2,h2]=contour(xx(6:300),yy(6:300),Theta_e(6:300,6:300),'--b','LineWidth',0.2,'ShowText','on','labelspacing', 700);
The postion of label in the blue lines are set with 'labelspacing'. But I want the position of the label in the blue lines at the end of the blue lines. I wonder how to do it.
Thanks in advance.

채택된 답변

Prasad Parameswaran
Prasad Parameswaran 2019년 10월 22일
The function "clabel" will solve the issue.
With "clabel(c,h,'manual')" command you can add the label at locations you select with the mouse. For further reference see this link.
  댓글 수: 1
Genhou SUN
Genhou SUN 2019년 10월 27일
Thanks a lot for your kind help. It is very helpful.

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

추가 답변 (1개)

Jelle Bakker
Jelle Bakker 2023년 2월 16일
You can also use seperate contour plots such that one of those plots only has contour lines on the left. You can then enable labels only for that one. The other contour plot will then not have any labels.

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by