npu.plot.plot_utils

Classes

PlotUtils()

class npu.plot.plot_utils.PlotUtils
Author:

Alberto M. Esmoris Pena

Class with util static methods for common plot operations.

static rows_and_cols_for_nplots(nplots, transpose=False)

Determine the number of rows and columns required to plot a grid of n subplots.

By default, the number of rows is greater than or equal to the number of columns. This condition can be reversed by setting transpose to True.

Parameters:
  • nplots – The number of subplots in the grid (n).

  • transpose – If True, return cols and rows instead of rows and cols.

Returns:

The number of rows and the number of columns required to plot n subplots.

Return type:

(int, int)