Skip to content

Commit a4c89c7

Browse files
committed
Try another way to add doc
1 parent 4eff743 commit a4c89c7

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

doc/api/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Plotting map elements
3737
Figure.text
3838
Figure.timestamp
3939
Figure.vlines
40+
Figure.clip
4041

4142
Plotting tabular data
4243
~~~~~~~~~~~~~~~~~~~~~

pygmt/figure.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ def __init__(self) -> None:
102102
self._preview_dir = TemporaryDirectory(prefix=f"{self._name}-preview-")
103103
self._activate_figure()
104104

105-
self.clip = clip()
106-
107105
def __del__(self) -> None:
108106
"""
109107
Clean up the temporary directory that stores the previews.
@@ -139,6 +137,17 @@ def region(self) -> np.ndarray:
139137
wesn = lib.extract_region()
140138
return wesn
141139

140+
@property
141+
def clip(self) -> clip:
142+
"""
143+
Set up a clipping path.
144+
145+
- :meth:`pygmt.Figure.clip.land`
146+
- :meth:`pygmt.Figure.clip.water`
147+
- :meth:`pygmt.Figure.clip.polygon`
148+
"""
149+
return clip()
150+
142151
def savefig(
143152
self,
144153
fname: str | PurePath,
@@ -415,7 +424,6 @@ def _repr_html_(self) -> str:
415424

416425
from pygmt.src import ( # type: ignore[misc]
417426
basemap,
418-
clip,
419427
coast,
420428
colorbar,
421429
contour,

0 commit comments

Comments
 (0)