Overview
nested_tiledlayout is a lightweight and intuitive class designed to simplify the creation and management of nested tiledlayout figures in MATLAB—no matter how many layers deep.
Key Features
- Effortlessly create any level of nested tiled layouts with just a single method call.
- Offers clean and simple access to frequently used layout settings such as titles, font sizes, axis labels, linked axes, and legend positioning—all of which are typically tedious to modify using standard MATLAB commands.
- Automatically generates a full-screen figure with tight padding and spacing by default, making your visualizations more compact and presentation-ready.
- Even if you don’t require nesting, this class serves as a user-friendly drop-in replacement for tiledlayout() with smarter defaults and better control.
Whether you're building complex dashboard-like visualizations or just want cleaner layout control with less code, nested_tiledlayout will make your workflow smoother and your plots cleaner.
All necessary class files, tutorials, and a demo script that generates the figure shown below are included in the downloadable file!
Demonstration
Want to see how easy it is to use nested_tiledlayout? Here’s a simple pseudocode-style walkthrough to give you a feel for how intuitive it is.
% Create a figure with an outer tiled layout (auto-maximized, tight spacing)
ntl = nested_tiledlayout();
% Add a plot to the main layout
ntl.nexttile();
plot(...);
% Create a nested tiled layout within a tile
ntl.make_tiles();
ntl.nexttile();
plot(...);
ntl.nexttile();
plot(...);
% Create a further nested level inside the current one
ntl.make_tiles();
ntl.nexttile();
plot(...);
% Go back up one level
ntl.out_tiles();
% Change appearance of current layout (e.g., title, legend)
ntl.change_settings("Title", "My Nested Section", "LegendLoc", "east");
% Jump back to the main layout
ntl.out_tiles();
% Add another plot at the outermost level
ntl.nexttile();
plot(...);
% Modify any layout layer (e.g., layer 1 is the outermost)
ntl.change_settings_layer(1, "Title", "Full Figure Layout", "TitleSize", 18);
引用格式
Fumiya (2025). nested_tiledlayout: Multi-Level Tiled Layouts in MATLAB (https://ww2.mathworks.cn/matlabcentral/fileexchange/180643-nested_tiledlayout-multi-level-tiled-layouts-in-matlab), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
创建方式
R2023a
兼容任何版本
平台兼容性
Windows macOS Linux标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!