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

Thread Subject:
Unable to clear the subplot images.

Subject: Unable to clear the subplot images.

From: Abhik Lodh

Date: 15 Feb, 2008 05:56:23

Message: 1 of 5

I have created figure file in which i have created four
buttons. through the gui control i select an input image
and subplot it.
%iNPUT IMAGE%
subplot(2,2,3)

now aafter doing the analysis (eg . DCT)i plot the output
in
% Output Image %
subplot(2,2,4)
Now i have created a button2_callback --- I want to clear
both the plotted inputimage & the output image to get clear
from the fig. on which it is plotted.

NB: For this I have used cla; function ; but it clears only
one image (current image i.e. image subplotted at (2,2,4).

Please help to clear both the images for a single callback.

regards
Abhik

Subject: Unable to clear the subplot images.

From: Pekka

Date: 15 Feb, 2008 06:59:27

Message: 2 of 5

"Abhik Lodh" <abhik_lodh@sify.com> wrote in message
<fp39i7$dkv$1@fred.mathworks.com>...
> I have created figure file in which i have created four
> buttons. through the gui control i select an input image
> and subplot it.
> %iNPUT IMAGE%
> subplot(2,2,3)
>
> now aafter doing the analysis (eg . DCT)i plot the output
> in
> % Output Image %
> subplot(2,2,4)
> Now i have created a button2_callback --- I want to clear
> both the plotted inputimage & the output image to get
clear
> from the fig. on which it is plotted.
>
> NB: For this I have used cla; function ; but it clears
only
> one image (current image i.e. image subplotted at (2,2,4).
>
> Please help to clear both the images for a single
callback.
>
> regards
> Abhik

You can give cla the handle of the axis object you want to
clear: doc cla
And subplot will give you the handle: doc subplot
h3 = subplot(2,2,3);
...
cla(h3)

You might want to save the axis handles to be able to use
them in other functions, see doc setappdata for example.

Subject: Unable to clear the subplot images.

From: Yumnam Kirani Singh

Date: 15 Feb, 2008 06:56:02

Message: 3 of 5

see the help on set and gcf about manipulating graphics handles.

Subject: Unable to clear the subplot images.

From: Ben Ward

Date: 10 Jan, 2013 10:26:08

Message: 4 of 5

subplot(2,2,3)
hold off
plot(NaN)

Subject: Unable to clear the subplot images.

From: Ben Ward

Date: 10 Jan, 2013 10:32:08

Message: 5 of 5

sorry, replying to wrong question

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us