How to reposition Labels of sfit Plot with Style Contour?

1 view (last 30 days)
Hi,
I am plotting a sfit-object like this:
p2 = plot(M_fit, 'Style', 'Contour');
set(p2, 'Fill', 'off', 'LineColor', 'auto','LineStyle','-','ShowText','on','LabelSpacing',700,'LineWidth',2);
I want to manuale reposition the labels of the contour lines. I don't get the desired results by changing 'LabelSpacing' has someone an idea on how to further influence the positions of the labels?
Thank you and have a nice day

Answers (1)

Vishwanath Bailore Acharya
Hello Stefan,
I understand that you want to manually reposition the labels of the contour lines.
This can be done by using “clabel”. To label the contour plot manually following command allows you to click in the plot and MATLAB creates labels at the selected position for the contour line under the mouse:
>> clabel(C,h,'manual')
where 'C' is Contour matrix returned by the "contour" function and 'h' is Contour object returned by the "contour" function.
For more information regarding “clabel” you can refer to the link below,
https://www.mathworks.com/help/releases/R2017b/matlab/ref/clabel.html
I hope this helps with your query.
Thanks
Vishwanath Acharya

Categories

Find more on Contour Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!