pygmt.params.Box

class pygmt.params.Box(clearance=None, fill=None, inner_gap=None, inner_pen=None, pen=None, radius=False, shading_offset=None, shading_fill=None)[source]

Class for the box around GMT embellishments.

Variables:
  • clearance

    Set clearances between the embellishment and the box border. Can be either a scalar value or a list of two/four values.

    • a scalar value means a uniform clearance in all four directions.

    • a list of two values means separate clearances in x- and y- directions.

    • a list of four values means separate clearances for left/right/bottom/top.

  • fill – Fill for the box. None means no fill.

Examples

>>> from pygmt.params import Box
>>> str(Box(fill="red@20"))
'+gred@20'
>>> str(Box(clearance=(0.2, 0.2), fill="red@20", pen="blue"))
'+c0.2/0.2+gred@20+pblue'
>>> str(Box(clearance=(0.2, 0.2), pen="blue", radius=True))
'+c0.2/0.2+pblue+r'
>>> str(Box(clearance=(0.1, 0.2, 0.3, 0.4), pen="blue", radius="10p"))
'+c0.1/0.2/0.3/0.4+pblue+r10p'
>>> str(
...     Box(
...         clearance=0.2,
...         pen="blue",
...         radius="10p",
...         shading_offset=("5p", "5p"),
...         shading_fill="lightred",
...     )
... )
'+c0.2+pblue+r10p+s5p/5p/lightred'
>>> str(Box(clearance=0.2, inner_gap="2p", inner_pen="1p,red", pen="blue"))
'+c0.2+i2p/1p,red+pblue'
>>> str(Box(clearance=0.2, shading_offset=("5p", "5p"), shading_fill="lightred"))
'+c0.2+s5p/5p/lightred'

Attributes