Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Help on text and colours

조회 수: 2 (최근 30일)
nty huy
nty huy 2019년 9월 27일
마감: MATLAB Answer Bot 2021년 8월 20일
so i have this graph
t = linspace(0,5*2*pi)';
y = cos(t);
plot(t,cos(t))
and i want some text in the middle how do i show the graph and the text this is what i have
t = text(0.5,0.5,'text');
s = t.FontSize;
t.FontSize = 11;
but whenever i use it the graph wont show
and how do i change the colour
  댓글 수: 1
Katarina Vuckovic
Katarina Vuckovic 2019년 9월 27일
You can use title('Enter Text') or legend('Enter Text')
As for the color, if you want to change to color of the plot use: https://www.mathworks.com/help/matlab/ref/linespec.html
If you want to change the color of the title: https://www.mathworks.com/help/matlab/ref/title.html

답변 (2개)

madhan ravi
madhan ravi 2019년 9월 27일
https://in.mathworks.com/help/matlab/ref/matlab.graphics.chart.primitive.line-properties.html
https://in.mathworks.com/help/matlab/ref/text.html#busm58r-2
  댓글 수: 1
KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 9월 27일
t = linspace(0,5*2*pi)';
y = cos(t);
plot(t,cos(t))
%hold on;
t=text(15,0,'Text');
s = t.FontSize;
t.FontSize = 15;

Katarina Vuckovic
Katarina Vuckovic 2019년 9월 27일
You can use title('Enter Text') or legend('Enter Text')
As for the color, if you want to change to color of the plot use: https://www.mathworks.com/help/matlab/ref/linespec.html
If you want to change the color of the title: https://www.mathworks.com/help/matlab/ref/title.html

태그

Community Treasure Hunt

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

Start Hunting!

Translated by