pygmt.params.Axis

class pygmt.params.Axis(annot=False, tick=False, grid=False, label=None, prefix=None, unit=None)[source]

Class for setting up one axis of a plot.

Examples

To specify the same attributes for all axes, with intervals of 4 for annotations, 2 for ticks, and 1 for gridlines:

>>> import pygmt
>>> fig = pygmt.Figure()
>>> fig.basemap(
...     region=[0, 10, 0, 20],
...     projection="X10c/10c",
...     frame=Axis(annot=4, tick=2, grid=1),
... )
>>> fig.show()
annot: float | bool = False

Specify the interval for annoations. It can be True to let GMT decide the interval automatically; or a value to set a specific interval in the format of stridephase][unit], where, stride is the interval, phase is the offset to shift the annotations by that amount, and unit is one of the 18 supported unit codes related to time intervals.

tick: float | bool = False

Specify the interval for ticks. Same format as annot.

grid: float | bool = False

Specify the interval for gridlines. Same format as annot.

label: str | None = None

Label for the axis [Default is no label].

prefix: str | None = None

A leading text prefix for the axis annotations (e.g., dollar sign for plots related to money) [For Cartesian plots only].

unit: str | None = None

Unix to append to the axis annotations [For Cartesian plots only].