pygmt.params.Position
- class pygmt.params.Position(location, type='plotcoords', anchor=None, offset=None)[source]
The class for positioning GMT embellishments.
Example
>>> import pygmt >>> from pygmt.params import Position >>> fig = pygmt.Figure() >>> fig.basemap(region=[0, 10, 0, 10], projection="X10c", frame=True) >>> fig.logo( ... position=Position((3, 3), type="mapcoords", anchor="ML", offset=(0.2, 0.2)), ... box=True, ... ) >>> fig.show()
-
location:
Union[Sequence[float|str],Literal['TL','TC','TR','ML','MC','MR','BL','BC','BR']] Specify the reference point on the plot. The method of defining the reference point is controlled by
type, and the exact location is set byposition.
-
type:
Literal['mapcoords','inside','outside','boxcoords','plotcoords'] = 'plotcoords' Specify the type of coordinates used to define the reference point. It can be one of the following values:
"mapcoords":positionis specified as (longitude, latitude) in map coordinates."boxcoords":positionis specified as (nx, ny) in normalized coordinates, i.e., fractional values between 0 and 1 along the x- and y-axes."plotcoords":positionis specified as (x, y) in plot coordinates, i.e., distances from the lower-left plot origin given in inches, centimeters, or points."inside"or"outside":positionis one of the nine two-character justification codes, indicating a specific location relative to the plot bounding box.
The default value is
"plotcoords".
-
anchor:
Optional[Literal['TL','TC','TR','ML','MC','MR','BL','BC','BR']] = None Specify the anchor point of the GMT logo, using one of the 2-character justification codes. The default value depends on
position_type.position_type="inside":anchordefaults to the same asposition.position_type="outside":anchordefaults to the mirror opposite ofposition.Otherwise,
anchordefaults to"MC"(middle center).
-
location: