Figure without border?

조회 수: 102 (최근 30일)
Marina
Marina 2019년 7월 10일
댓글: Marina 2019년 7월 10일
hello,
Can you make a figure without a border? I need the data to ocupy the entire figure window. Is this possible?
thanks,
marina

채택된 답변

Adam Danz
Adam Danz 2019년 7월 10일
편집: Adam Danz 2019년 7월 10일
fh = figure('Menu','none','ToolBar','none');
ah = axes('Units','Normalize','Position',[0 0 1 1])
ADDENDUM
If you're using axis square you'll need to make sure the figure position is also square. Here's a demo following the block above:
plot(rand(1000,1),rand(1000,1),'ko')
axis(ah, 'square')
fh.Position(3) = fh.Position(4); %set width equal to height
  댓글 수: 2
Marina
Marina 2019년 7월 10일
thanks! This eliminates the top and bottom border but I still have a left/right white border. Any ideas? :)
Adam Danz
Adam Danz 2019년 7월 10일
편집: Adam Danz 2019년 7월 10일
It eliminates all borders except for the figure window itself. I've added some data to the axes to show that.
If you're using axis square see the addendum in my answer.

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

추가 답변 (1개)

Steven Lord
Steven Lord 2019년 7월 10일
When you say "figure" do you mean the figure object (the window on the screen) or the axes contained in the figure? I've seen people use that word in both meanings.
If you want to maximize the figure object (the window on the screen) and you're using release R2018a or later, use the WindowState property of the figure object.
If you want to make the axes span the entirety of the figure window, do as Adam Danz suggested.
If you want the axes to span the entirety of a maximized figure object, combine Adam's suggestion and mine. Maximize the figure then make the axes with 'Units', 'normalized' and 'Position', [0 0 1 1].
  댓글 수: 1
Marina
Marina 2019년 7월 10일
I meant maximize the axes in the figure so no blank border around is left. Your answers worked great. Thanks for taking the time.

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

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by