arrange_subplots
Automatically computes the #rows and #columns needed to show N subplots. This function takes the size of images into consideration.
Can be used to provide inputs for subplot or subplot_tight
function [nrow, ncol] = arrange_subplots(n,imagesz)
Purpose
Calculate how many rows and columns of sub-plots are needed to
neatly display n subplots. This function considers the size of each subplot.
Inputs
n - the desired number of subplots.
imagesz - [height, width] of each subplot. default([1,1])
Outputs
[nrow, ncol] - defining the number of rows and number of columns required to show n plots.
Example: [nrow, ncol] = arrange_subplots(26, [200,500])
[nrow, ncol] = arrange_subplots(26)
Written by Geng Zhang. (www.bfcat.com). Jan. 2013
Cite As
Geng (2024). arrange_subplots (https://www.mathworks.com/matlabcentral/fileexchange/40024-arrange_subplots), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Graphics > Formatting and Annotation > Axes Appearance > Combine Multiple Plots > Subplots >
Tags
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.0.0 |