Insert degree symbol in axis title.
45 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Kamruzzaman Bhuiyan
am 1 Sep. 2021
Verschoben: Stephen23
am 16 Nov. 2025 um 12:10
Please see the attached image. How can i add such degree symbol in a matlab figure?
2 Kommentare
Akzeptierte Antwort
the cyclist
am 1 Sep. 2021
The degree symbol is ASCII character 176. So, here is a simple way:
% Plot some random data
plot(rand(100,1),rand(100,1),'.')
% Set the tick positions, and label them with degrees
set(gca,'XTick',[0 0.5 1],'XTickLabel',{['98',char(176),'E'],['99',char(176),'E'],['100',char(176),'E']})
There are more sophisticated ways to build a longer vector (but using the same basic idea), e.g. using sprintf.
2 Kommentare
Weitere Antworten (2)
Voss
am 1 Sep. 2021
xt = get(gca,'XTick');
xtl = arrayfun(@(x)sprintf('%d\\circE',x),xt,'UniformOutput',false);
set(gca,'XTickLabel',xtl);
0 Kommentare
Fangjun Jiang
am 1 Sep. 2021
Bearbeitet: Fangjun Jiang
am 1 Sep. 2021
title('9^oE')
text(0.5,0.5,'9^oE')
xticklabels({'0^oE','1^oE'})
doc title
search for "superscript"
0 Kommentare
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

