pygmt.params.Axis
class pygmt.params. Axis ( annot = False , tick = False , grid = False , label = None , prefix = None , unit = None , angle = None ) [source]
Class for setting up one axis of a plot.
Examples
To specify the same attributes for x- and y-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 | str | bool = False
Specify the interval for annotations. It can be True to let GMT decide the
interval automatically; or a value to set a specific interval in the format of
stride [±phase ][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 | str | bool = False
Specify the interval for ticks. Same format as annot .
grid : float | str | 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
Unit to append to the axis annotations [For Cartesian plots only].
angle : float | None = None
Angle of the axis annotations.
© Copyright 2017-2026, The PyGMT Developers.
Revision be3c2e58 .
Last updated on Mar 10, 2026.
Built with Sphinx
using a theme
provided by Read the Docs
This website uses Google Analytics to gather usage statistics.
However, it does not use cookies or track you across different websites.
Page view data are used to help us improve the site and provide an estimate of the
software usage.