Display comma instead of dot at contour levels?

조회 수: 2 (최근 30일)
Ingo Rück
Ingo Rück 2017년 12월 14일
댓글: Ingo Rück 2017년 12월 17일
Hello everyone,
the title is basically my whole question. I want to change the labels on the contour levels of a contour plot so that the numbers have a comma instead of a dot (its a german thing).
I've read that following code would have worked in older versions of Matlab - C and h being the outputs of the contour function:
acl=clabel(C,h,'FontSize',10,'Color','k');
for i=1:length(acl)
oldlabel=get(acl(i), 'String');
newlabel=strrep(oldlabel, '.', ',');
set(hcl(i),'String',newlabel);
end
In the Matlab version I'm using, clabel is returning a "GraphicsPlaceholder"-Object, which I cannot change in the same way. How would I change the labels in Matlab version R2017a ?
(Same question has been posted here in german)

채택된 답변

Walter Roberson
Walter Roberson 2017년 12월 14일
Yair recently posted some details on customizing contour lines and labels. See https://undocumentedmatlab.com/blog/customizing-contour-plots-part2
  댓글 수: 6
Walter Roberson
Walter Roberson 2017년 12월 16일
Thanks, Yair.
Ingo Rück
Ingo Rück 2017년 12월 17일
Thank you very much, this turned out a lot more complicated than I thought it would!

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

추가 답변 (0개)

카테고리

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