subplot with number on top of bar

조회 수: 3 (최근 30일)
Matlabbey
Matlabbey 2012년 9월 8일
hi all!
if you are plotting a bar how is it possible to put the number on top of the bar so it is easier to look at?
thank you!!

채택된 답변

Image Analyst
Image Analyst 2012년 9월 8일
  댓글 수: 2
Image Analyst
Image Analyst 2012년 9월 8일
OK now you edited it to be a different question. This answer would be to use the text() function to place text wherever you want it.
Matlabbey
Matlabbey 2012년 9월 8일
Hi thank you! It will come in handy sorry about change of question

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

추가 답변 (1개)

Tom
Tom 2012년 9월 8일
편집: Tom 2012년 9월 8일
You can use the annotation function to do this, there are a few ways to choose how to position the text.
AX=zeros(4,1);
for ii=1:4
AX(ii)=subplot(2,2,ii);
plot(rand(5))
end
A=annotation('textbox',[0.45,0.95,0.1,0.1],...
'String','Main Title',...
'HorizontalAlignment','Center',...
'VerticalAlignment','Bottom',...
'BackgroundColor','none',...
'EdgeColor','none');
See
doc annotation
for details

카테고리

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