subplot to specific figure

조회 수: 45 (최근 30일)
Jason
Jason 2014년 11월 24일
댓글: Sebastian Baur 2022년 8월 29일
How do you ensure a subplot is always on a particular figure that is open.
My figure is assigned>:
hFig=figure('Position',[400 200 1200 600]);
movegui(hFig,'center')
sometime if I touch my GUI, it will plot to an axes on the gUI and not the figure hFig as requested. So I want to force it, I thought the following should work:
hFig;
h1=subplot(2,2,1);
I also add text when I create mt figure that is displayed un til the subplot is plotted then it goes. I do use hold on; How can I have text permanently on (here is my text command)
hFig=figure('Position',[400 200 1200 600]);
movegui(hFig,'center')
axes('position',[0.0,0.0,1,1],'visible','off');
text(0.1,0.05,['folder=',folder],'Fontsize',8,'Interpreter','none');
hold on;

채택된 답변

Orion
Orion 2014년 11월 24일
Hi,
you can do
set(0,'CurrentFigure',hFig) % you say to Matlab to make hFig thecurrent figure
h1=subplot(2,2,1);
...
  댓글 수: 2
Jason
Jason 2014년 11월 24일
How about the text part of the question, making is permanent? Thanks
Sebastian Baur
Sebastian Baur 2022년 8월 29일
I know this is way too late to answer to the OP, but here is the way I prefer doing this:
h1 = subplot(2, 2, 1, 'Parent', hFig);

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by