From: John on
Hello,

I have a code that generates a series of axes (the number of which is user-defined) that lay over one another to create what appears to be one plot.

In order to pass the properties of each of these axes between callbacks, I have to use GUIDATA (I think). This is what's happening:

1) Axes arrays are created in the "PLOT Button" callback:
handles.PLOTaxes(1)
handles.PLOTaxes(2)
handles.PLOTaxes(3)
handles.PLOTaxes(4) ... and so on.
2) In the same callback, I set the handles structure (above) to GUIDATA:
guidata(hObject, handles)
3) In order to clear the plots, I need to pass each handles.PLOTaxes(i) to the "CLEAR Button" callback. So, in the "CLEAR Button" callback, i write:
handles = guidata(handles.PLOTbutton) %This GETS guidata

At this point, I can only access handles.PLOTaxes(1) which is actually the last created plot. How do I make it so that ALL of the PLOTaxes - PlotAxes(1), (2), (3), and (4) - handles get into the "CLEAR Button" callback?
From: John on
RESOLVED






"John " <jfishbac(a)gmail.com> wrote in message <i1ndab$m3r$1(a)fred.mathworks.com>...
> Hello,
>
> I have a code that generates a series of axes (the number of which is user-defined) that lay over one another to create what appears to be one plot.
>
> In order to pass the properties of each of these axes between callbacks, I have to use GUIDATA (I think). This is what's happening:
>
> 1) Axes arrays are created in the "PLOT Button" callback:
> handles.PLOTaxes(1)
> handles.PLOTaxes(2)
> handles.PLOTaxes(3)
> handles.PLOTaxes(4) ... and so on.
> 2) In the same callback, I set the handles structure (above) to GUIDATA:
> guidata(hObject, handles)
> 3) In order to clear the plots, I need to pass each handles.PLOTaxes(i) to the "CLEAR Button" callback. So, in the "CLEAR Button" callback, i write:
> handles = guidata(handles.PLOTbutton) %This GETS guidata
>
> At this point, I can only access handles.PLOTaxes(1) which is actually the last created plot. How do I make it so that ALL of the PLOTaxes - PlotAxes(1), (2), (3), and (4) - handles get into the "CLEAR Button" callback?