필터 지우기
필터 지우기

Display degree symbol on the plot

조회 수: 9 (최근 30일)
Bruno
Bruno 2016년 12월 14일
답변: Star Strider 2016년 12월 15일
I am trying to display the degree symbol °on the plot using annotation; I am using the maximum degree value.
text(x12(imax),y12(imax),['max.=',num2str(fix(y12(imax)))^{\circ}],...
'VerticalAlignment','bottom','HorizontalAlignment',...
'left','FontSize',12,'FontWeight','bold');

답변 (2개)

Star Strider
Star Strider 2016년 12월 15일
Instead of:
['max.=',num2str(fix(y12(imax)))^{\circ}]
I would use:
sprintf('max.=%.2f^{\\circ}', y12(imax))
This works:
text(x12(imax),y12(imax),sprintf('max.=%.2f^{\\circ}', y12(imax)),...
'VerticalAlignment','bottom','HorizontalAlignment',...
'left','FontSize',12,'FontWeight','bold');

KSSV
KSSV 2016년 12월 15일
clc; clear all ;
x = rand(10,1) ;
y = rand(10,1) ;
plot(x,y) ;
title('Temeprature T^0C')
text(x(7),y(7),'Temeprature T^0C')

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by