-
Notifications
You must be signed in to change notification settings - Fork 232
Figure.plot/Figure.plot3d: Improve the docstrings for straight_line #3720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
caef6e9
1361602
21ed3f9
d3071a3
98d195e
3c3c52a
48febe5
9aa8f97
b839e2d
7009972
9c148cf
dd5f63b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
plot - Plot in two dimensions. | ||
""" | ||
|
||
from typing import Literal | ||
|
||
from pygmt.clib import Session | ||
from pygmt.exceptions import GMTInvalidInput | ||
from pygmt.helpers import ( | ||
|
@@ -49,7 +51,15 @@ | |
) | ||
@kwargs_to_strings(R="sequence", c="sequence_comma", i="sequence_comma", p="sequence") | ||
def plot( | ||
self, data=None, x=None, y=None, size=None, symbol=None, direction=None, **kwargs | ||
self, | ||
data=None, | ||
x=None, | ||
y=None, | ||
size=None, | ||
symbol=None, | ||
direction=None, | ||
straight_line: bool | Literal["x", "y"] = False, # noqa: ARG001 | ||
**kwargs, | ||
): | ||
r""" | ||
Plot lines, polygons, and symbols in 2-D. | ||
|
@@ -98,18 +108,22 @@ def plot( | |
depending on the style options chosen. | ||
{projection} | ||
{region} | ||
straight_line : bool or str | ||
[**m**\|\ **p**\|\ **x**\|\ **y**]. | ||
By default, geographic line segments are drawn as great circle | ||
arcs. To draw them as straight lines, use | ||
``straight_line=True``. | ||
Alternatively, add **m** to draw the line by first following a | ||
meridian, then a parallel. Or append **p** to start following a | ||
parallel, then a meridian. (This can be practical to draw a line | ||
along parallels, for example). For Cartesian data, points are | ||
simply connected, unless you append **x** or **y** to draw | ||
stair-case curves that whose first move is along *x* or *y*, | ||
respectively. | ||
straight_line | ||
By default, line segments are drawn as straight lines in the Cartesian and polar | ||
coordinate systems, and as great circle arcs (by resampling coarse input data | ||
along such arcs) in the geographic coordinate system. The ``straight_line`` | ||
parameter can control the drawing of line segments. Valid values are: | ||
|
||
- ``True``: Draw line segments as straight lines in geographic projections. | ||
- ``"x"``: Draw line segments by first along *x*, then along *y*. | ||
- ``"y"``: Draw line segments by first along *y*, then along *x*. | ||
|
||
Here, *x* and *y* have different meanings depending on the coordinate system: | ||
|
||
- **Cartesian** coordinate system: *x* and *y* are the X- and Y-axes. | ||
- **Polar** coordinate system: *x* and *y* are theta and radius. | ||
- **Gragraphic** coordinate system: *x* and *y* are parallels and meridians. | ||
|
||
|
||
{frame} | ||
{cmap} | ||
offset : str | ||
|
Uh oh!
There was an error while loading. Please reload this page.