What's wrong with this textbox annotation?

조회 수: 2 (최근 30일)
dave
dave 2013년 7월 13일
I'd like to create a textbox annotation in a figure called "figure1", but it always gives me an error saying that there are too many input arguments for "annotation". Here's what I do:
annotation(figure1,'textbox',[0.2726 0.638 0.1111 0.05249],...
'String',{'Slope = Hp'},...
'HorizontalAlignment','center',...
'FontSize',14,...
'FitBoxToText','off');
What's wrong with this?
  댓글 수: 1
per isakson
per isakson 2013년 7월 13일
편집: per isakson 2013년 7월 13일
Which Matlab release? It works here with R2012a.

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

채택된 답변

Image Analyst
Image Analyst 2013년 7월 13일
It worked for me. You did do this before you called it, didn't you:
figure1 = figure;
  댓글 수: 3
Image Analyst
Image Analyst 2013년 7월 13일
편집: Image Analyst 2013년 7월 13일
Run this:
figure1 = figure;
annotation(figure1,'textbox',[0.2726 0.638 0.1111 0.05249],...
'String',{'Slope = Hp'},...
'HorizontalAlignment','center',...
'FontSize',14,...
'FitBoxToText','off');
It gives no errors or warnings whatsoever. Is it possible you redefined annotation() with your own function? What does this say:
>> which -all annotation
dave
dave 2013년 7월 14일
Thanks Image Analyst...I had some toolbox installed which contained a function "annotation". So I renamed the function and now everything works as expected.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by