From 0d814b2a97476838b7869847ecdd3e5a6f6f18d9 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 6 Apr 2026 15:48:50 +0800 Subject: [PATCH] Frame: Allow setting 'axis' and 'zaxis' simultaneously --- pygmt/params/frame.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/pygmt/params/frame.py b/pygmt/params/frame.py index da23288ab1c..ff485595455 100644 --- a/pygmt/params/frame.py +++ b/pygmt/params/frame.py @@ -175,10 +175,11 @@ class Frame(BaseParam): #: Specify the attributes for axes by an :class:`Axis` object. #: - #: The attributes for each axis can be specified in two ways: (1) specifying the - #: same attributes for all axes using the ``axis`` parameter; (2) specifying the - #: attributes for each axis separately using the ``xaxis``, ``yaxis``, ``zaxis`` - #: parameter for the x-, y, and z-axes, respectively. + #: The attributes for x and y axes can be specified in two ways: (1) specifying the + #: same attributes for both axes using the ``axis`` parameter; (2) specifying the + #: attributes for each axis separately using the ``xaxis`` and ``yaxis`` parameters. + #: The attributes for z-axis can only be specified separately using the ``zaxis`` + #: parameter. #: #: GMT uses the notion of primary (the default) and secondary axes, while secondary #: axes are optional and mostly used for time axes annotations. To specify the @@ -197,13 +198,10 @@ def _validate(self): Validate the parameters of the Frame class. """ if self.axis is not None and any( - [self.xaxis, self.yaxis, self.zaxis, self.xaxis2, self.yaxis2, self.zaxis2] + [self.xaxis, self.yaxis, self.xaxis2, self.yaxis2] ): raise GMTParameterError( - conflicts_with=( - "axis", - ["xaxis", "yaxis", "zaxis", "xaxis2", "yaxis2", "zaxis2"], - ), + conflicts_with=("axis", ["xaxis", "yaxis", "xaxis2", "yaxis2"]), reason="Either 'axis' or the individual axis parameters can be set, but not both.", )