Can I put a subplot within a GUI axes?

17 Ansichten (letzte 30 Tage)
Miles Stephenson
Miles Stephenson am 26 Jan. 2016
Kommentiert: Miles Stephenson am 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?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 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.

Weitere Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by