Re: Displaying Graphs in a GUI
- From: "lee " <leevonk@xxxxxxxxxxx>
- Date: Wed, 31 Oct 2007 19:35:21 +0000 (UTC)
This is how I did it, GUIGraph_Chan1 and GUIGraph_Chan2 are
the tags of my axes in the gui, you have to tell matlab
which axis you want to plot on before each plot.
code below:
axes(handles.GUIGraph_Chan1);
plot(MyWaveform_Chan1);
axes(handles.GUIGraph_Chan2);
plot(MyWaveform_Chan2);
"Scott Dobbins" <scott.dobbins@xxxxxxxxxxx> wrote in message
<fga39r$kf4$1@xxxxxxxxxxxxxxxxxx>...
I've created a GUI that displays a graph. It works fine.
Psuedocode follows:
function pushbutton6_Callback(hObject, eventdata, handles)
SimpleWaveformViewer(handles.fn); % plots first graph
guidata(hObject, handles);
I edited my fig file to add another set of axes for a second
graph. I want to display both graphs with the same pushbutton.
function pushbutton6_Callback(hObject, eventdata, handles)
SimpleWaveformViewer(handles.fn); % plots first graph
SimpleFFTViewer(handles.fn); % plots second graph
guidata(hObject, handles);
But when I do this, the second graph replaces the first.
The second set of axes is blank.
So how do I direct the first graph to be plotted on the
first set of axes, and the second graph to be plotted on the
second set of axes? This is confusing, because in my fig
file, I have objects labeled axes9 and axes8. The graph
always plots in axes9. But nowhere in my GUI code is there
a reference to axes9 (or axes8, for that matter.) Pretty
confusing.
When I was building my fig, MATLAB automatically created a
pushbutton1 callback that calls out axes1:
function pushbutton1_Callback(hObject, eventdata, handles)
axes(handles.axes1);
cla;
guidata(hObject, handles);
Also automatically created was an axes create function:
function axes1_CreateFcn(hObject, eventdata, handles)
I don't understand, because my fig contains a pushbutton6,
axes9 and axes8. What's up with a pushbutton1 callback and
code for an axes1? These don't even exist in my fig. Yep,
confusing.
Thanks in advance for your help.
.
- References:
- Displaying Graphs in a GUI
- From: Scott Dobbins
- Displaying Graphs in a GUI
- Prev by Date: Re: a problem with embedded function in Simulink
- Next by Date: .mex file execution error
- Previous by thread: Displaying Graphs in a GUI
- Next by thread: New figure window popup
- Index(es):