Align figures without overlap

This function set figures' position to avoid overlap of figures.
250 Downloads
Updated 18 Sep 2016

View License

function align_figure(hfig, target_mon, width, height, margin_top, margin_left, margin_btw_width, margin_btw_height)
% align_figure: align figures without overlap
%
% Yonggyu Han / Yonsei university / 2016.02.18
%
% This function set figures' position to avoid overlap of figures.
%
% Example:
%
% hfig1 = figure();
% hfig2 = figure();
% hfig3 = figure();
% hfig = [hfig1 hfig2 hfig3];
% align_figure(hfig);
%
% target_mon (for multiple monitor users)
% ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
% s
% s margin_top
% s
% s wwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwww
% s w width w w w
% s w w w w
% s w h w w w
% s w e w w w
% s margin_left w i fig1 w margin_btw_width w fig2 w
% s w g w w w
% s w h w w w
% s w t w w w
% s w w w w
% s w w w w
% s wwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwww
% s
% s margin_btw_height
% s
% s wwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwww
% s w w w w
% s w w w w
% s w w w w
% s w w w w
% s w fig3 w w fig4 w
% s w w w w
% s w w w w
% s w w w w
% s w w w w
% s w w w w
% s wwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwww
% s
% s

Cite As

YongGyu Han (2024). Align figures without overlap (https://www.mathworks.com/matlabcentral/fileexchange/55468-align-figures-without-overlap), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.2.0.0

I had forgot to update m file, so I did

1.1.0.0

Add target_mon for multiple monitor

1.0.0.0