polartoolkit.square_subplots

Contents

polartoolkit.square_subplots#

square_subplots(n)[source]#

From matplotlib/grid-strategy Calculate the number of rows and columns based on the total number of items (n) to make an arrangement as close to square as looks good.

Parameters:

n (int) – The number of total plots in the subplot

Returns:

Returns a tuple in the format (number of rows, number of columns), so for example a 3 x 2 grid would be represented as (3, 3), because there are 2 rows of length 3.

Return type:

tuple[int, int]