How to reset axes plot upon pressing run button within GUI

5 views (last 30 days)
I have a very simple GUI which plots a graph depending on users input into my gui axes.
Problem is that everytime I press calcuate instead of clearing the axes and plotting the new data. It simply plots on top
as you can see it adds another line on top.
I've tired
cla reset
and
delete (plot)
neiter of which work, any suggestions?

Accepted Answer

Monica Roberts
Monica Roberts on 6 May 2022
You could call cla with the uiaxes as the input:
cla(app.UIAxes) % Or whatever your uiaxes handle is called
  1 Comment
Logan Das
Logan Das on 6 May 2022
Yep that worked!
I've been putting the cla below my plot scipt instead of on top.
Thanks!

Sign in to comment.

More Answers (0)

Categories

Find more on Specifying Target for Graphics Output in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!