myfigure - extension of MATLAB's figure
Version 1.0 (361 KB) by
Oleg Iupikov
Creates figure window with extra options, non-overlapping placement of multiple figures, and profile management.
myfigure
Creates figure window with extra options, non-overlapping placement of multiple figures, and profile management.
Overview
The function myfigure is an extention built on top of MATLAB's figure function, which allows:
- figure creation on the user-specified monitor (in multi-monitor systems)
- automatic placement of new figure next to the existing one to avoid their overlapping;
- optionally, if there are many figures, new figures can be placed on multiple monitors;
- automatic setting of the figure size same as the previous figure, or manual size setting;
- specifying distance between figures ("gaps") and distance to the screen borders ("margins");
- creating axes: single or tiled layout (uses MATLAB's tiledlayout);
- setting axes properties;
- executing user-defined functions after creating the figure or axes on it;
- disabling the figure's menu bar and tool bar;
- setting standard figure properties;
- saving all above to a profile, and create new figures with desired behaviour by just specifying the profile name;
- selection of existing figure by a text label.
Documentation and examples
For the full function documentation, see attached Live Script and demo files.
After defining figure profiles once (see demo2_generate_banner_case.m), one can just use them as
myfigure(size=[800 400]);
myfigure(profile="demo_profile_with_axes");
myfigure(profile="demo_profile_3D_plots_1x2");
myfigure(profile="demo_profile_with_axes_2x3");
This will create the following non-overlapping figures on the screen:
Cite As
Oleg Iupikov (2024). myfigure - extension of MATLAB's figure (https://www.mathworks.com/matlabcentral/fileexchange/133447-myfigure-extension-of-matlab-s-figure), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2023a
Compatible with R2021b and later releases
Platform Compatibility
Windows macOS LinuxTags
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.
Version | Published | Release Notes | |
---|---|---|---|
1.0 |