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

71 ビュー (過去 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 Center および File ExchangeContour Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by