fig_size

fig_size(width=None, height=None, ratio=0.618)[source]

Converts rcParams['savefig.figsize'] units to inches.

For figures with axes of fixed aspect ratio, width and height are to be interpreted as maximum values.

Parameters:
  • width (float, default height / ratio) – Figure width as a fraction of its rcParams['figure.figsize'] (default: [6.4, 4.8]) value.

  • height (float, default width * ratio) – Figure height as a fraction of its rcParams['figure.figsize'] (default: [6.4, 4.8]) value.

  • ratio (float, default golden ratio 0.618) – Height to width ratio, ignored if both size values are given.

Returns:

Figure width and height, in inches.

Return type:

tuple[float]