필터 지우기
필터 지우기

Is it possible to add a textbox outside the axes of a plot figure window?

조회 수: 350 (최근 30일)
John
John 2011년 10월 6일
I have tried the command "text(x,y,'String')" but that requires a specific location and my figure window plots always have different axes numbers.
I would like this textbox to always appear outside the axes as well (along the grey left part of the figure window)
How can this be done?
  댓글 수: 1
Jan
Jan 2011년 10월 7일
You forgot to mention, if you want to display the text relative to an axes or to the figure, or absolute in the figure etc. Settign the text location is easy, but it is hard to explain as long, as we have to guess, what you want exactly.

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

답변 (2개)

Daniel Shub
Daniel Shub 2011년 10월 7일
figure;
plot(rand(5, 1))
annotation('textbox', [0, 0.5, 0, 0], 'string', 'My Text')

Sean de Wolski
Sean de Wolski 2011년 10월 6일
Change your figure units to pixels and then it'll be consistent.
H = figure;
set(H,'units','pix','size',...)
%etc.
  댓글 수: 2
Fangjun Jiang
Fangjun Jiang 2011년 10월 6일
When I do H=figure;plot(1:10);get(h,'units'), it returns 'pixels'. Should it be any one of the others?
[ inches | centimeters | normalized | points | {pixels} | characters ]
Sean de Wolski
Sean de Wolski 2011년 10월 7일
You have a capital H and a lowercase h, fyi. Maybe it's the axes that should be in pixels instead of normalized?

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

카테고리

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