File Exchange

image thumbnail

Border-less tight subplot (auto-refresh)

version 1.1.5 (4.27 KB) by Eduard Reitmann
Creates subplot axes similar to the subplot function, but minimizes the white space between the different axes. Can be used for single axes.

29 Downloads

Updated 26 Jul 2018

View Version History

View License

Creates subplot axes similar to the subplot function, but minimizes the white space between the different axes. Similar to the "Expand axes to fill figure" command in the export tool but works for subplots too. The white space removal is performed when the figure's 'SizeChangedFcn' callback is executed. Initiates when figure becomes visible for the first time. Automatically refreshes each time the figure is resized.

Use subplotXmanyY_er for plots with mutual x-axis.

Can be used for single axes figures too.

Note: Not compatible with legends/colorbars outside the axes borders. Must use 'inside' legends/colorbars.

Cite As

Eduard Reitmann (2020). Border-less tight subplot (auto-refresh) (https://www.mathworks.com/matlabcentral/fileexchange/68326-border-less-tight-subplot-auto-refresh), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (8)

Jérémy Pinguet

Pierre-Emmanuel Oms

Hi everyone,
How to convert the figure back in centimerters or pixel when we print ?
In screen the figure appears great but not after my print ...

Jon Jae

Answer to my question below: subplot_er changes the figure units from pixels to normalized. You need to convert it back to pixels to set the position

Jon Jae

Question: Is there a way to size and save the figure? if I use e.g., 'set(gcf,'position',[10,10,300,100])' the figure seems to be missbehaving. First the figure window is full-screen than it switches to small, than it goes off screen to the right.

dafei liu

Nice work!

Wei-Heng Hsu

Matthias Flór

Perfect, so easy to use!

Rolien Rossouw

MATLAB Release Compatibility
Created with R2018a
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!