How to dock multiple plots/images in main figure window? - matlab

I have a GUI that shells a program generating a plot as output.
Each time the user presses 'OK', a new plot is made, appearing in a new window.
What I'd like to have is the following:
User starts GUI, enters required input parameters and presses 'OK'.
A 'main' figure window opens and a plot appears as a docked figure in the main window.
User changes the settings and confirms with 'OK'.
Another docked figure showing a new plot is added to the main window.
etc.
For me it's not clear how to:
Define the main/parent figure window that will hold the generated children plot figures.
Add these plot figures to the main figure window.
If I start with:
set(0,'DefaultFigureWindowStyle','docked')
is it possible then to further customize some properties of the main window?
I think of title, position, no menubar, ...
Can anyone help me with some hints?
Thanks!
Notes:
It seems that it's not possible to dock figures in a predefined figure window; you can only dock to the desktop. That's what I understand until now since searching the internet.

Yes, you surely can customize the figure window.
You can set the title of the figure window using 'Name' property in the following way:
set(gcf,'Name','Title');
Similarly, you can use 'Menubar' property and 'Toolbar' property to control the display of the toolbar.
Also, you can set the position using 'Position' property.
Refer to the following link for all the figure properties you can set:
http://www.mathworks.com/help/techdoc/ref/figure_props.html
Hope it helps...all the best!!

Yes, Matlab does not allow to dock figures into several different windows but there is a tool on Matlab file exchange which provides that functionality:
http://www.mathworks.com/matlabcentral/fileexchange/16650

Related

MATLAB embed figure window into the editor as a tab

Is there a way to prevent the MATLAB from creating a separate figure window, and instead show it as a tab in the editor, like the command window or workspace / variables tabs? I'd like to see the figure on the side while still writing on the full-size window. I looked into the settings and couldn't find anything related.
To do it programmatically, just set the figure's 'WindowStyle' property to 'Docked'. You can do that when you create the figure:
f = figure('WindowStyle', 'Docked');

How to show menubar in figure matlab

I used some comment in below to disable the menubar in figure. Now, I want to display it again. I could not find the way to do it. Could you guide me how to show it in figure again
This is what I tried to disable menubar
iptsetpref('ImshowBorder','tight');
set(0,'DefaultFigureMenu','none');
set(0,'Default');
The default value for the option 'DefaultFigureMenu' is 'figure'. The other option, as you have noticed, is 'none', which will disable the menu bar. This and other information about figure properties may be found in the documentation.
The menu bar reappears in any new figures you open once you assign the value back to its default setting:
set(0,'DefaultFigureMenu','figure');
As a side note, setting properties with first argument 0 makes the property value changes global (i.e. they apply to every figure), at least for the duration of your current MATLAB session.

How to create a save button in Matlab GUI

In Matlab, when we plot a graph it opens a figure window, which has a save button that allows the user to save figures in different file format.
I have created a GUI which plots a graph. Now I want a similar save button in my GUI, which works like the one in figure window.
What would be the code exactly for such push button? I tried saveas(), which doesn't work as expected.

MATLAB GUI) Initial Tab selection

I am making a simple GUI that reads some parameters in EditBox and do something.
I have a lot of EditBoxs and it is convenient to move by Tab Button between boxes.
I want the text in the next box to be initially selected by Tab Button so that I don't need to do Ctrl+A and remove the text before typing new strings.
I couldn't find any information from web, and searched in the Property Inspector of Editbox but no luck.
Does anyone know how to do this?
Thanks in advance.

How to make a figure invisible the first time I open in in Matlab GUIDE

I'm making a GUI using matlab GUIDE. Since GUIDE doesn't support tabs, I have a pop down menu where the user selects different options. Depending on the selected options, certain buttons appear and disappear, this is easily handled by turning the handle visibility on/off.
However, the first time I run the GUI, i can see all my buttons, even though their default handle visibility is off. The moment I select something from the pop down menu, everything is fine.
How do I make a figure invisible for the very first time the GUI is opened?
Thanks!
Try the drawnow command at the end of the initialization code of your GUI (see doc here). It should force the update of the GUI and hopefully set the visibility of your objects correctly.