Skip to content

Commit b61639a

Browse files
committed
Add doctests
1 parent 0ba431d commit b61639a

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

pygmt/params/frame.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
from pygmt.exceptions import GMTParameterError
99
from pygmt.params.base import BaseParam
1010

11+
__doctest_skip__ = ["Axis", "Frame"]
12+
1113

1214
@dataclasses.dataclass(repr=False)
1315
class Axis(BaseParam):
@@ -20,7 +22,7 @@ class Axis(BaseParam):
2022
2 for ticks, and 1 for gridlines:
2123
2224
>>> import pygmt
23-
>>> fig = pygmmt.Figure()
25+
>>> fig = pygmt.Figure()
2426
>>> fig.basemap(
2527
... region=[0, 10, 0, 20],
2628
... projection="X10c/10c",
@@ -108,7 +110,7 @@ class Frame(BaseParam):
108110
... projection="X10c/10c",
109111
... frame=Frame(axes="WSrt", axis=Axis(annot=4, tick=2, grid=1)),
110112
... )
111-
... fig.show()
113+
>>> fig.show()
112114
113115
To specify the attributes for each axis separately:
114116
@@ -118,11 +120,11 @@ class Frame(BaseParam):
118120
... projection="X10c/10c",
119121
... frame=Frame(
120122
... axes="WSrt",
121-
... xaxis=Axis(annot=4, tick=2, grid=1, label="X-axis"),
122-
... yaxis=Axis(annot=5, tick=2.5, grid=1, label="Y-axis"),
123+
... xaxis=Axis(annot=4, tick=2, grid=1, label="X Label"),
124+
... yaxis=Axis(annot=5, tick=2.5, grid=1, label="Y Label"),
123125
... ),
124126
... )
125-
... fig.show()
127+
>>> fig.show()
126128
"""
127129

128130
#: Controls which axes are drawn and whether they are annotated, using a combination

0 commit comments

Comments
 (0)