Filter löschen
Filter löschen

Problem with GUI plotting

2 Ansichten (letzte 30 Tage)
Dimitris Arapidis
Dimitris Arapidis am 22 Sep. 2013
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?

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 22 Sep. 2013
add
hold(handles.axes1, 'on')
  3 Kommentare
Azzi Abdelmalek
Azzi Abdelmalek am 22 Sep. 2013
I misunderstood your question
cla(handles.axes1)
plot....
Dimitris Arapidis
Dimitris Arapidis am 22 Sep. 2013
thank you

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

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

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by