필터 지우기
필터 지우기

How can I give degree symbol in XTicklabel in a bar graph?

조회 수: 10 (최근 30일)
Md Zillur Rahman
Md Zillur Rahman 2015년 10월 28일
댓글: Md Zillur Rahman 2015년 10월 29일
I used the following code in Matlab 2013b to give degree symbol in X-axis tick label.
set(gca,'XTicklabel',{'Neat PP';'0^{\circ}';'30^{\circ}';'45^{\circ}';'60^{\circ}';'90^{\circ}'})
It did not help me (please see attached figure). Can anyone please give me solution? Thank you.

채택된 답변

Stalin Samuel
Stalin Samuel 2015년 10월 28일
set(gca,'XTicklabel',{'Neat PP'; [sprintf('0%c', char(176))];[sprintf('30%c', char(176))];[sprintf('45%c', char(176))];[sprintf('60%c', char(176))];[sprintf('90%c', char(176))]})

추가 답변 (1개)

Stephen23
Stephen23 2015년 10월 28일
편집: Stephen23 2015년 10월 28일
Make sure that the axes' TickLabelInterpreter property is set to either tex or latex:
The documentation includes a list of the TEX symbols and commands that can be used in MATLAB: click on the arrow in the subheading to show the full list.
  댓글 수: 1
Steven Lord
Steven Lord 2015년 10월 28일
The TickLabelInterpreter property was introduced as part of the new graphics system in release R2014b. It is not available in release R2013b.

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

카테고리

Help CenterFile Exchange에서 Labels and Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by