필터 지우기
필터 지우기

How to isolate a figure created in the callback of a GUI?

조회 수: 2 (최근 30일)
Adam Hicks
Adam Hicks 2018년 10월 17일
댓글: Adam Hicks 2018년 10월 17일
I have a GUI which displays next to a graph and contains a single input of an offset value for the graph. The callback for the edit text "refreshes" the graph by re-graphing. However, when it does this in the callback function the new graph displays within the GUI. Is there a way to isolate the handles/figures so that each is a separate figure? Here is a simplified example of my code:
gfig = graph(data);
handle.offset = uicontrol('Style','edit',...
'String',offset,...
'HorizontalAlignment','center',...
'Position',[63 50 40 25],...
'Callback',@regraph);
function regraph(varargin)
close(gfig);
data = data + offset;
gfig = graph(data);
end
  댓글 수: 4
Adam
Adam 2018년 10월 17일
Which graph function are you using? The one I see in my Matlab does not appear to plot anything with the 1 argument syntax.
Adam Hicks
Adam Hicks 2018년 10월 17일
The graph function I am using is overloaded and is not a standard Matlab function. Essentially, it plots the data in the provided structure and returns the handle to the figure it creates.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기

태그

제품


릴리스

R2010b

Community Treasure Hunt

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

Start Hunting!

Translated by