Updated 2 May 2017
layout.GridBagLayout and layout.ScrollableGridBagLayout are MATLAB classes which control layout and resize of a figure/uipanel/uicontainer. This class helps the MATLAB GUI developer design complex Graphical User Interfaces without the need for calculations or complex code for performing initial layouts or writing resize functions.
To get this to work in 2007b/2008a you can simply replace the calls to ishghandle(h, 'figure') with strcmp(get(h, 'type'), 'figure').
Jason (2023). GridBagLayout (https://www.mathworks.com/matlabcentral/fileexchange/22968-gridbaglayout), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
- MATLAB > App Building >
- MATLAB > App Building > Migrate GUIDE Apps >
Inspired: UISIGNALBUILDER, GridLayout, UISignalBuilder2
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Add new ScrollableGridBagLayout for layouts that are bigger than the size available.
Update for new MATLAB Graphics system. Fix bug when making the UI visible for the first time.
Handle the user-defined Max < default Min case by not allowing the Minimum values to ever be greater than the corresponding Maximum values.
Fix a bug with the use of UIPanel. Take into account the BorderWidth property when calculating the number of pixels available for the layout.
Make Axes positioning dependent on the ActivePositionProperty. Thanks for the catch Ryan.
Fix typos and Axes positioning.
Update layout method to better handle Axes using the 'OuterPosition' property so that Insets are not always necessary. This will use MATLAB's built-in axes spacing management.
Removed log files that were not relevant or useful.