Skip to content

Commit d8f247e

Browse files
committed
Update docstrings
1 parent c9bdfe0 commit d8f247e

1 file changed

Lines changed: 32 additions & 23 deletions

File tree

pygmt/src/clip.py

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -37,31 +37,40 @@ def clip(self, data=None, x=None, y=None, **kwargs):
3737
Pass in either a file name to an ASCII data table, a 2D {table-classes}.
3838
x/y : 1d arrays
3939
The x and y coordinates of the clip path.
40-
{B}
41-
{J}
42-
{R}
43-
straight_line : bool or str
44-
[**m**\|\ **p**\|\ **x**\|\ **y**\|\ **r**\|\ **t**].
45-
By default, geographic line segments are connected as great circle
46-
arcs. To connect them as straight lines, use ``straight_line``.
47-
Alternatively, add **m** to connect the line by first following a
48-
meridian, then a parallel. Or append **p** to start following a
49-
parallel, then a meridian. (This can be practical to connect a line
50-
along parallels, for example). For Cartesian data, points are
51-
simply connected, unless you append **x** or **y** to draw
52-
stair-case curves that whose first move is along *x* or *y*,
53-
respectively. For polar projection, append **r** or **t** to connect
54-
staircase curves whose first move is along *r* or *theta*,
55-
respectively.
40+
{frame}
41+
{projection}
42+
{region}
43+
straight_line
44+
By default, line segments are drawn as straight lines in the Cartesian and polar
45+
coordinate systems, and as great circle arcs (by resampling coarse input data
46+
along such arcs) in the geographic coordinate system. The ``straight_line``
47+
parameter can control the drawing of line segments. Valid values are:
48+
49+
- ``True``: Draw line segments as straight lines in geographic coordinate
50+
systems.
51+
- ``"x"``: Draw line segments by first along *x*, then along *y*.
52+
- ``"y"``: Draw line segments by first along *y*, then along *x*.
53+
54+
Here, *x* and *y* have different meanings depending on the coordinate system:
55+
56+
- **Cartesian** coordinate system: *x* and *y* are the X- and Y-axes.
57+
- **Polar** coordinate system: *x* and *y* are theta and radius.
58+
- **Geographic** coordinate system: *x* and *y* are parallels and meridians.
59+
60+
.. attention::
61+
62+
There exits a bug in GMT<=6.5.0 that, in geographic coordinate systems, the
63+
meaning of *x* and *y* is reversed, i.e., *x* means meridians and *y* means
64+
parallels. The bug is fixed by upstream
65+
`PR #8648 <https://github.com/GenericMappingTools/gmt/pull/8648>`__.
5666
invert : bool
57-
Invert the sense of what is inside and outside. For example, when
58-
using a single clip path, use ``invert=True`` to only plot points
59-
outside to path. Cannot be used with ``frame``.
60-
{V}
67+
Invert the sense of what is inside and outside. For example, when using a single
68+
path, ``invert=True`` means only plot points outside that path will be shown.
69+
Cannot be used together with ``frame``.
70+
{verbose}
6171
pen : str
62-
Draw the output of the clip path using the pen attributes before
63-
clipping is initiated [Default is no outline].
64-
72+
Draw outline of clip path using given pen attributes before clipping is
73+
initiated [Default is no outline].
6574
6675
Examples
6776
--------

0 commit comments

Comments
 (0)