Resizable MATLAB figures

A simple mechanism for creating graphical user interfaces which resize tidily
3,6K download
Aggiornato 1 set 2016

Visualizza la licenza

This is a layout manager for axes and controls in a MATLAB figure, designed for graphical user interfaces in which, during resizing of the figure, some controls (e.g. buttons) are to remain the same size while others (e.g. axes, text fields, list boxes) are to change size.
To achieve this, the figure is split into a grid with a border and with spacing between each cell. Some rows and columns (at least one of each) are variable in size and the rest are fixed. When the figure is resized, the available space (i.e. that not required by the fixed-size rows and columns) is distributed among the variable-sized ones according to a specified ratio. If there is not enough space for the fixed-size rows or columns, these (and the spacing between them) will be made smaller too.

Controls can be merged across multiple rows and/or columns and can overlap (making it possible to put a frame round other controls).

Example code is provided. The basic sequence is:
* Create figure (using the supplied function "resizable_figure")
* Create controls (axes, uicontrols, ActiveX controls, java components)
* Create an "elements" cell-matrix to specify top-right positions for controls.
* Create a "mergeblocks" matrix giving sizes for components which span more than one cell in the grid
* Specify row and column sizes (positive sizes are specify fixed sizes in pixels, negative ones give the ratios for resizable rows and columns)
* Set the initial size for the figure and show it

The code has been tested with MATLAB 6.1 (R12.1) through MATLAB 7.1 (R14sp3).

Cita come

Malcolm Wood (2025). Resizable MATLAB figures (https://www.mathworks.com/matlabcentral/fileexchange/10309-resizable-matlab-figures), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R12.1
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Migrate GUIDE Apps in Help Center e MATLAB Answers
Riconoscimenti

Ispirato: Yet Another Layout Manager

Community Treasure Hunt

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

Start Hunting!
Versione Pubblicato Note della release
1.2.0.1

Updated license

1.2.0.0

Added copyright statements, and eliminated the need for a P-coded file.

1.1.0.0

Review

1.0.0.0

Added a published M-file example