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 |