Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
931bfc1
Figure.clip: Initial implementation
seisman Mar 26, 2025
bb32777
Define more classes
seisman Apr 26, 2025
14a49b9
Merge branch 'main' into feature/clip
seisman May 1, 2025
430bb39
Merge branch 'main' into feature/clip
seisman May 3, 2025
5fc8871
Merge branch 'main' into feature/clip
seisman May 12, 2025
83f04fa
Improve docstrings
seisman May 12, 2025
ccf4d92
Update clip.land and clip.water
seisman May 12, 2025
1784795
Update clip.solar
seisman May 13, 2025
05bd0c0
Merge branch 'main' into feature/clip
seisman May 17, 2025
cc46add
Replace self._preprocess with self._activate_figure
seisman May 17, 2025
105c317
Add more aliases to clip
seisman May 19, 2025
a95d351
Add fmt_docstring
seisman May 19, 2025
3573bd7
Fix a doctest
seisman May 19, 2025
a9527ae
Fix docstring
seisman May 19, 2025
ca8dd43
Merge branch 'main' into feature/clip
seisman May 20, 2025
faaabb7
clip.polygon should accept a path or pandas object
seisman May 21, 2025
6cf4956
Move clip.dcw before clip.polygon
seisman May 22, 2025
88d198a
Merge branch 'main' into feature/clip
seisman May 24, 2025
f34a297
Merge branch 'main' into feature/clip
seisman May 25, 2025
a4955b9
Updates
seisman May 25, 2025
d8d33d0
Merge branch 'main' into feature/clip
seisman Sep 20, 2025
19bc113
Merge branch 'main' into feature/clip
seisman Sep 21, 2025
6d96b27
Merge branch 'main' into feature/clip
seisman Sep 24, 2025
f601459
Update to the new syntax
seisman Sep 24, 2025
5bcfaef
Merge branch 'main' into feature/clip
seisman Oct 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
.. rubric:: Attributes

{% for item in attributes %}
.. autoattribute::
{{ objname }}.{{ item }}
.. autoattribute:: {{ objname }}.{{ item }}
:no-index:
{% endfor %}
{% endif %}

Expand Down
2 changes: 2 additions & 0 deletions doc/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Plotting map elements
:toctree: generated

Figure.basemap
Figure.clip
Figure.coast
Figure.colorbar
Figure.hlines
Expand Down Expand Up @@ -238,6 +239,7 @@ Miscellaneous

which
show_versions
src.ClipAccessor

Datasets
--------
Expand Down
10 changes: 10 additions & 0 deletions pygmt/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from typing import Literal, overload

from pygmt._typing import PathLike
from pygmt.src import ClipAccessor

try:
import IPython
Expand Down Expand Up @@ -145,6 +146,15 @@ def region(self) -> np.ndarray:
wesn = lib.extract_region()
return wesn

@property
def clip(self) -> ClipAccessor:
"""
Set up a clipping path and only plot data inside/outside it.

See :class:`pygmt.src.clip.ClipAccessor <ClipAccessor>` for the usage.
"""
return ClipAccessor(self)

def savefig(
self,
fname: PathLike,
Expand Down
1 change: 1 addition & 0 deletions pygmt/src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pygmt.src.basemap import basemap
from pygmt.src.binstats import binstats
from pygmt.src.blockm import blockmean, blockmedian, blockmode
from pygmt.src.clip import ClipAccessor
from pygmt.src.coast import coast
from pygmt.src.colorbar import colorbar
from pygmt.src.config import config
Expand Down
Loading
Loading