How can I get new plot on the same axes when the user put the new input and presses push button?

조회 수: 1 (최근 30일)
Hello, I am developing a gui in which I have given the push button and some inputs. After pressing push button plot will generate on the axes of the gui but the problem is occurring in the next step when I will again put the new value in the input then the plot is being overwrite by the old plot. How can I remove the old plot after putting the new inputs?
Thanks
  댓글 수: 4
Adam
Adam 2017년 1월 24일
If you want to clear all existing plots when you next press the button you need to put
hold( handles.plotAxes, 'off' )
at the start. Or
cla( handles.plotAxes )

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

채택된 답변

Niels
Niels 2017년 1월 24일
if you use
hold on
every next (new) plot will added to the old plot, so both/ all plots will be shown.
to deactivate adding plots use hold off (documentation of hold)
hold off % default option, only need to use if you used hold on before
so that every new plot automatically deletes the old one

추가 답변 (0개)

카테고리

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