MATLAB Answers

GUI plotting to axes once a seperate figure is opened

조회 수: 1(최근 30일)
Jason
Jason 8 Dec 2014
댓글: Adam 8 Dec 2014
I have a gui that has a pushbutton and an axes. The push button runs a function (seperate m file) that creates a figure and some subplots. When I then try to do something on axes1 on the original GUI, its not plotting. Im guessing, it cant find the handle to the component as I also have a figure open.
im calling the axes1 component via: handles.axes1
It is the only component called axes1, so I cant understand why I can't plot to this once I have already plotted to a seperate figure?

  댓글 수: 1

Adam
Adam 8 Dec 2014
It would help if you post the actual plot instruction you are using for your axes1

로그인 to comment.

답변(2개)

Robert Cumming
Robert Cumming 8 Dec 2014
are you specifying the axes in the plot command? If not Matlab will plot in the current active axes (gca).
Its advisable to specify the axes to plot in:
plot ( axesHandle, X, Y, .... );
So in your case:
plot ( handles.axes1, X, Y, .... );

  댓글 수: 0

로그인 to comment.


Jason
Jason 8 Dec 2014
Hi, no I wasn't. I have just tried but still nothing.

  댓글 수: 0

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.

태그


Translated by