필터 지우기
필터 지우기

Insert Degree Symbol in Axes Title

조회 수: 1,461 (최근 30일)
Med_Imager
Med_Imager 2012년 3월 15일
편집: Zayin Jarrez 2024년 3월 4일
Hello
Anyone know how to display the degree symbol ° in the title on a plot? Also want to know how to display it on the top of the figure.
set (Handle3, 'NumberTitle', 'Off', 'Name', 'Slice profile for a 20^{\circ} sinc pulse ');
axis auto;title('Slice profile for a 20^{\circ} sinc pulse ');
Thanks!

채택된 답변

Thomas
Thomas 2012년 3월 15일
편집: MathWorks Support Team 2019년 5월 22일
You can create any character by finding its Unicode value and converting that number into a character, using the “char” function. Then you can add that character to any character vector or string.
For example, the number 176 is the Unicode value that denotes the degree symbol. You can convert 176 to a character and add it to your text.
axes
title(['Slice profile for a 20' char(176) ' sinc pulse'])
Setting the figure title is similar, but you have to set the 'Name' property. You might want to turn the 'NumberTitle' off too.
figure('Name', ['Slice profile for a 20' char(176) ' sinc pulse'], 'NumberTitle', 'off')
The list of all Unicode characters is very large. For more information, including the numeric values of Unicode characters, see:

추가 답변 (3개)

Engenuity
Engenuity 2016년 11월 6일
ALT + 248 does the trick using Windows OS
  댓글 수: 7
Kenneth George
Kenneth George 2022년 7월 8일
Not sure if this will help someone in the future, but I ran across this and realized that typing the numbers using the number row on my keyboard does not work, but typing the numbers using the numpad does work. Can't tell if this is keyboard dependent, but occurs with both my laptop and desktop. Disappointing for users that don't have a numpad.
Zayin Jarrez
Zayin Jarrez 2024년 3월 4일
편집: Zayin Jarrez 2024년 3월 4일
Nice trick

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


carlo lefevre
carlo lefevre 2016년 2월 3일
°C

Honglei Chen
Honglei Chen 2012년 3월 15일
By default, title('20^{\circ}') should work. If not, you can do
title('20^{\circ}','Interpreter','tex')
  댓글 수: 1
Brian
Brian 2015년 9월 21일
\circ is apparently not the same as a degree symbol. Journals sometimes object to the \circ characterization of the degree symbol.

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

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by