Effacer les filtres
Effacer les filtres

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

59 vues (au cours des 30 derniers jours)
Genhou SUN
Genhou SUN le 19 Oct 2019
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.

Réponse acceptée

Prasad Parameswaran
Prasad Parameswaran le 22 Oct 2019
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 commentaire
Genhou SUN
Genhou SUN le 27 Oct 2019
Thanks a lot for your kind help. It is very helpful.

Connectez-vous pour commenter.

Plus de réponses (1)

Jelle Bakker
Jelle Bakker le 16 Fév 2023
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.

Catégories

En savoir plus sur Contour Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by