Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations pierreick on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gui problems

Status
Not open for further replies.

dacbs

Bioengineer
Feb 27, 2009
1
I have been programming an interface in Matlab/guide and I need to open two guis, where different plots will be generated. The different guis are formed inside a function that contain all the plotting variables. In this case the guis never have total control of the system.

This first gui posses "gui1.axes1" and "gui1,axes2" and the second gui "gui2.axes3". Here is an example of the code

GuiOneHandle = Gui1();
GuiOneData = guidata(GuiOneHandle);

GuiTwoHandle = Gui2();
GuiTwoData = guidata(GuiTwoHandle);

%% First Gui plots
axes(GuiOneData.axes1)
plot(1:x,1:x,'r'),hold on
plot(1:x,1:x,'*');
plot(GuiOneData.axes2, 1:x,1:x,'g'), hold on
plot(GuiOneData.axes2, 1:x,1:x,'--k')

I have two problems. The first problem I have now, is that when I try to access the axes outside the gui, when I define the variable "axes(GuiOneData.axes1)" or "set(GuiOneData.figure,'CurrentAxes')" it doesn't recognize it, and opens immediately another figure and plots in both in it, second if I use "plot(GuiOneData.axes2, 1:x,1:x,'g')" again it opens an extra figure not plotting anything inside of it, but in this case it respects only the second plot one and makes the figure it directly inside the correct axes. My question here is how I can go through this so it plots both inside the axes and later if I want to plot something else inside of them.

The second problem is that, the gui will be open throw the hole file and again I will want to save the axes properties and plot them in another file or another time, so how can I plot this axes_handle in another figure without having the data, only the handle.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor