Display Several Plots in GUI using Slider

조회 수: 4 (최근 30일)
Avri
Avri 2013년 8월 28일
I’m building a GUI that supposes to display several subplots. In order to display a subplot in the GUI I create a uipanel and set subplot(2,2,x,’Perent’,h_panel) where h_panel is the handle of the uipanel. Inside the code there is a ‘for’ loop and each iteration display a different subplot. I would like to have the opportunity to display all the subplots after the loop is done (using slider). Can I save the handle of each subplot or its struct array and then to redisplay it?

채택된 답변

Jing
Jing 2013년 8월 28일
편집: Jing 2013년 8월 28일
Get the return of the SUBPLOT, then you can save the handle to each subplot.
h=subplot(2,2,x,Perent,h_panel); %h is the handle to the new axes object.
What do you mean by redisplay? How do you hide it? If it's just not in focus, use AXES could bring it back:
axes(h)
  댓글 수: 2
Avri
Avri 2013년 8월 28일
I have function that create a subplot and displays it into a figure. In order to display it at GUI I changed the subplot to be displaying into uipanel (i.e. subplot(1,1,1,'Perent',h_uipanel)). The GUI code contain ‘for’ loop in case the GUI’s user want to display several subplots. The problem is that each iteration overwrites the previous subplot. I need the ability to somehow “save” each subplot (i.e h(i) = get(handles.uipanel,’Children’)) in order to allow the user to display it later by using Slider (i.e copyobj(h(i),handles.uipanel)). Theoretically I can rerun the function at each use in the slider but the running time of the function is too long and I prefer to display the subplot differently.
Jing
Jing 2013년 9월 18일
편집: Jing 2013년 9월 18일
So you subplots are overwritten by others? I mean, for each iteration, a new subplot will cover the old one? If so, you can just hide the old subplot and just show the new one, and then show the old one when it's needed.
set(h,'Visible','off') %hide the subplot
set(h,'Visible','off') %show it
But if you have a lot of subplots, it requires a lot java heap memory to hold them.

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

추가 답변 (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