MATLAB Answers


How to: Renew Graph / figure / GUI

Asked by Hello kity on 28 Dec 2012


i have build a gui which plots some graphs. I can choose what I want to plot by a popup box (case1, case 2 etc). The problem is, for example case1 consits of 3 subplots, it plots 3 graphs. And case2 consists of a single graph. If i choose case 1 first, it plots 3 graphs, then afterwards if i choose case 2 it plots its single graph in the 3rd subplot.... instead of clearing the window and making a single plot.

i tried clf, cla but dont work. how can i fix this?

thank you



No products are associated with this question.

1 Answer

Answer by Azzi Abdelmalek
on 28 Dec 2012
Edited by Azzi Abdelmalek
on 28 Dec 2012
 Accepted answer



  1 Comment

yea why not create a subplot for a single graph :)

thank you, this worked

Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!