Create an annotation into a plot

조회 수: 2 (최근 30일)
Tiago Dias
Tiago Dias 2018년 11월 19일
댓글: madhan ravi 2018년 11월 19일
Hello,
When i create an annotation into a plot to show me a specific value that I have previously calculated, in the plot it shows me a square, instead of the value I wanted.
This is what I got, keigenvalue is a number 6 for example.
keigenvalue = find(lambda > 1, 1, 'last'); % Gives me the number of principal components that got a eigenvalue superior than 1
y1 = plot(lambda,'*r');
dim = [0.2 0.5 0.3 0.3];
str = ['PC selected =' keigenvalue];
annotation('textbox',dim,'String',str,'FitBoxToText','on');
Thanks for your help.

채택된 답변

madhan ravi
madhan ravi 2018년 11월 19일
편집: madhan ravi 2018년 11월 19일
str = ['PC selectec =' num2str(keigenvalue)]; %if it doesn't work provide all your values
  댓글 수: 2
Tiago Dias
Tiago Dias 2018년 11월 19일
It works, thanks!
madhan ravi
madhan ravi 2018년 11월 19일
Anytime :)

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by