×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Gui problems

Gui problems

Gui problems

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources