Date: Dec 30, 2012 1:41 AM
Author: Bruno Luong
Subject: Re: GUI

Debora <deboralabella17@gmail.com> wrote in message <5ca12dc8-c53c-4fa6-9dbf-79cf392ba935@googlegroups.com>...

> [q w]=size(AV);
> for i=1:w
> AV(:,i)=AV(:,i)+((i-1)*MAX1);
> figure (1);
> subplot(2,1,1)
> hold on
> plot(AV(:,i),my_colors{i})
> ...
>
> end
>
> but this way I open a window with the graphic, and I want it on the interface. how should I do?


If you want to plot on the GUI, you need to create an AXE which has the GUI figure as Parents (usually it names handles.figure1 inside the callback), then use the handle of the AXE to plot. Do not create a new figure with figure(1) command. If you use GUIDE, you have the axe button on the left panel to add an axe.

...
ax = subplot(2,1,1, 'Parent', handles.figure1)
hold(ax, 'on');
plot(ax,AV(:,i),my_colors{i});
...

Bruno