layouts

Attributes

PRESET_SHAPES

Functions

rows_cols(num_subplots[, rows, columns, max_columns])

Calculate the number of rows and columns for a figure with the given number

Module Contents

layouts.PRESET_SHAPES
layouts.rows_cols(num_subplots, rows=None, columns=None, max_columns=8)

Calculate the number of rows and columns for a figure with the given number of subplots.

Parameters:
  • num_subplots (int) – The number of subplots to be plotted.

  • rows (int, optional) – The number of rows in the figure. If not provided, it will be calculated based on the number of columns and the number of subplots.

  • columns (int, optional) – The number of columns in the figure. If not provided, it will be calculated based on the number of rows and the number of subplots.

  • max_columns (int, optional) – The maximum number of columns in the figure. Default is 8.