gsplot.InsetSpec#

class InsetSpec(*, bounds=None, width=None, height=None, loc='upper right', bbox_to_anchor=None, borderpad=0.5)#

Bases: object

Immutable placement specification for an explicit parent Axes.

Parameters:
  • bounds (tuple[float, float, float, float] | None) – Optional (left, bottom, width, height) parent-coordinate bounds.

  • width (float | str | None) – Optional numeric or Matplotlib percentage sizes. Both are required when bounds is omitted.

  • height (float | str | None) – Optional numeric or Matplotlib percentage sizes. Both are required when bounds is omitted.

  • loc (str | int) – Matplotlib location name or integer code from 1 through 10.

  • bbox_to_anchor (tuple[float, ] | None) – Optional two- or four-value finite anchor box.

  • borderpad (float) – Non-negative inset border padding.

Notes

Instances are frozen and accept exactly one placement mode: bounds or width plus height.

Examples

>>> import gsplot as gs
>>> spec = gs.InsetSpec(bounds=(0.6, 0.6, 0.3, 0.3))
>>> spec.bounds
(0.6, 0.6, 0.3, 0.3)
__init__(*, bounds=None, width=None, height=None, loc='upper right', bbox_to_anchor=None, borderpad=0.5)#
Parameters:
  • bounds (tuple[float, float, float, float] | None)

  • width (float | str | None)

  • height (float | str | None)

  • loc (str | int)

  • bbox_to_anchor (tuple[float, ...] | None)

  • borderpad (float)

Return type:

None

Methods

__init_subclass__

This method is called when a class is subclassed.

__new__(**kwargs)

__subclasshook__

Abstract classes can override this to customize issubclass().