upxo.viz.helpers module

Created on Wed Feb 5 22:59:37 2025

@author: Dr. Sunil Anandatheertha

upxo.viz.helpers.arrange_subplots(N, Rmax, Cmax)[source]

Arranges N subplots within Rmax x Cmax grid, prioritizing rows <= columns.

Calculates the optimal number of rows and columns for a subplot grid, prioritizing arrangements where the number of rows is less than or equal to the number of columns.

Parameters:
  • N (int) – The total number of subplots required.

  • Rmax (int) – The maximum permissible number of rows.

  • Cmax (int) – The maximum permissible number of columns.

Returns:

A tuple containing the number of rows and columns (nrows, ncols) for the subplot arrangement. Returns None if no valid arrangement is possible within the constraints.

Return type:

tuple (int, int) or None