pygmt.params.Axis

class pygmt.params.Axis(annotation=None, tick=None, grid=None, angle=None, skip_edge=False, fancy=False, label=None, hlabel=None, alt_label=None, alt_hlabel=None, prefix=None, unit=None)[source]

Class for setting up one axis of a plot.

annotation: float | None = None

Intervals for annotations, ticks and grid lines.

angle: float | None = None

Plot slanted annotations (for Cartesian plots only), where angle is measured with respect to the horizontal and must be in the -90 <= angle <= 90 range. Default is normal (i.e., angle=90) for y-axis and parallel (i.e., angle=0) for x-axis annotations. These defaults can be changed via MAP_ANNOT_ORTHO.

skip_edge: Literal['left', 'right'] | bool = False

Skip annotations that fall exactly at the ends of the axis. Choose from left or right to skip only the lower or upper annotation, respectively, or True to skip both.

fancy: bool = False

Give fancy annotations with W|E|S|N suffixes encoding the sign (for geographic axes only).

label: str | None = None

Add a label to the axis (for Cartesian plots only). The label is placed parallel to the axis by default; use hlabel to force a horizontal label for y-axis, which is useful for very short labels.

alt_label: str | None = None

Add an alternate label for the right or upper axes. The label is placed parallel to the axis by default; use alt_hlabel to force a horizontal label for y-axis, which is useful for very short labels. [For Cartesian plots only].

prefix: str | None = None

Add a leading text prefix for axis annotation (e.g., dollar sign for plots related to money) (for Cartesian plots only). For geographic maps the addition of degree symbols is automatic and controlled by FORMAT_GEO_MAP.

unit: str | None = None

Append a unit to the annotations (for Cartesian plots only). For geographic maps the addition of degree symbols, etc. is automatic and controlled by FORMAT_GEO_MAP.