Can I put a subplot within a GUI axes?
21 views (last 30 days)
Show older comments
Miles Stephenson
on 26 Jan 2016
Commented: Miles Stephenson
on 27 Jan 2016
I have a basic GUI I created with Guide. Within my GUI, I have a couple axes, one where I play a video, and another where I plot some related data. I'd like to plot the data using subplots, but I want to contain it within the data axes. Whenever I use the subplot command, the data is plotted across the entire GUI figure window.
Is it possible to contain the subplots within the axes, or otherwise prevent it from taking up the entire GUI window?
0 Comments
Accepted Answer
Walter Roberson
on 26 Jan 2016
subplot() are axes, and axes cannot be contained within axes. You can construct the axes with whatever Position property is appropriate. You can construct multiple such axes.
What you would probably find easiest is to create a uipanel and plot entirely within the uipanel.
panhandle = uipanel('Position', ....);
pax11 = subplot(2,2,1,'Parent', panhandle);
pax12 = subplot(2,2,2,'Parent', panhandle);
...
handles.panhandle = panhandle;
handles.pax11 = pax11;
handles.pax12 = pax12;
...
guidata(hObject, handles);
Or you can construct the uipanel and axes in GUIDE ahead of time.
More Answers (0)
See Also
Categories
Find more on Graphics Object Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!