Automatically Refresh a plot in GUIDE

조회 수: 1 (최근 30일)
Wendy Fernandez
Wendy Fernandez 2017년 9월 15일
댓글: Wendy Fernandez 2017년 9월 16일
I am using GUIDE to plot a graph of data that is being updated in a fixed period. Therefore, I want to refresh automatically my plot in the GUI. I followed the instructions from this link: https://www.mathworks.com/help/matlab/creating_guis/automatically-refresh-plot-in-a-guide-gui.html
I am able to update the plot. But, the plot is being updated in a figure outside my GUI, which is not what I desire. See attached figure. How can I fix this?
  댓글 수: 2
Joseph Cheng
Joseph Cheng 2017년 9월 15일
편집: Joseph Cheng 2017년 9월 15일
if you could paste in the sections of code that does the defining which axes to update and the sections that does the updating.
One thought is that you did not set the target axes inside the gui as they have done in the example. such that when you do update/plot it again it opens a new figure.
Wendy Fernandez
Wendy Fernandez 2017년 9월 16일
Thank you, Joseph Cheng, for your suggestion.

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

채택된 답변

Jan
Jan 2017년 9월 16일
See the code in the example, which updates the data of the existing plot only, instead of drawing a new one:
set(handles.surf, 'ZData', Z);
If you post your code, we could suggest which line has to be modified.
  댓글 수: 1
Wendy Fernandez
Wendy Fernandez 2017년 9월 16일
Thank you very much, this solved my problem!

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

추가 답변 (1개)

Von Duesenberg
Von Duesenberg 2017년 9월 16일
axes(h), where h is the handle for the axes you want, before the plot command, should do the trick.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by