gsplot.box_aspect#

box_aspect(target, aspect)#

Set or clear an explicit Axes box aspect.

Parameters:
  • target (Axes | _AxesBase | Sequence[Axes | _AxesBase] | Mapping[Any, Axes | _AxesBase] | ndarray[tuple[int, ...], dtype[Any]]) – One Axes, an ordered Axes sequence, or an Axes mapping.

  • aspect (float | None) – Positive aspect ratio, or None to clear the constraint.

Returns:

The supplied Axes objects are updated in place.

Return type:

None

Raises:

LayoutError – If the target or aspect is invalid.

Examples

>>> import gsplot as gs
>>> figure, ax = gs.subplots()
>>> gs.box_aspect(ax, 1.0)
>>> figure.clear()