Problem with GUI plotting

2 次查看(过去 30 天)
I run a GUI where i enter values through edit boxes in order to take a plot, for example a simple line between A and B (i enter their coordinates through the boxes)
The function that plot the line is called from a push button.
I enter the A,B coordinates, press the button and get the plot with the line.
If, while still running the GUI, i enter a different value for A or B and press the button i get two lines in the plot.
What can i do so that when i press the button for a second time the first plot gets erased and the second plot is displayed alone?

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2013-9-22
add
hold(handles.axes1, 'on')
  3 个评论
Azzi Abdelmalek
Azzi Abdelmalek 2013-9-22
I misunderstood your question
cla(handles.axes1)
plot....

请先登录,再进行评论。

更多回答(1 个)

Image Analyst
Image Analyst 2013-9-22
Put
cla reset
before you plot the new line. Or else
hold off
would probably work too.

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by