Skip to content

Commit 6ea53ee

Browse files
committed
Alias straight_lines(A), error_bars(E), close(L), position(D) for plot
1 parent 3b4199a commit 6ea53ee

File tree

1 file changed

+44
-28
lines changed

1 file changed

+44
-28
lines changed

pygmt/base_plotting.py

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -606,47 +606,49 @@ def grdview(self, grid, **kwargs):
606606

607607
@fmt_docstring
608608
@use_alias(
609-
R="region",
610-
J="projection",
609+
A="straight_lines",
611610
B="frame",
612-
S="style",
611+
C="cmap",
612+
D="position",
613+
E="error_bars",
613614
G="color",
615+
J="projection",
616+
L="close",
614617
N="no_clip",
615-
W="pen",
616-
i="columns",
617-
l="label",
618-
C="cmap",
618+
R="region",
619+
S="style",
619620
U="timestamp",
620621
V="verbose",
622+
W="pen",
621623
X="xshift",
622624
Y="yshift",
625+
i="columns",
626+
l="label",
623627
p="perspective",
624628
t="transparency",
625629
)
626630
@kwargs_to_strings(R="sequence", i="sequence_comma", p="sequence")
627631
def plot(self, x=None, y=None, data=None, sizes=None, direction=None, **kwargs):
628632
"""
629-
Plot lines, polygons, and symbols on maps.
630-
631-
Used to be psxy.
633+
Plot lines, polygons, and symbols in 2-D.
632634
633635
Takes a matrix, (x,y) pairs, or a file name as input and plots lines,
634636
polygons, or symbols at those locations on a map.
635637
636638
Must provide either *data* or *x* and *y*.
637639
638-
If providing data through *x* and *y*, *color* (G) can be a 1d array
639-
that will be mapped to a colormap.
640+
If providing data through *x* and *y*, *color* can be a 1d array that
641+
will be mapped to a colormap.
640642
641-
If a symbol is selected and no symbol size given, then psxy will
643+
If a symbol is selected and no symbol size given, then plot will
642644
interpret the third column of the input data as symbol size. Symbols
643645
whose size is <= 0 are skipped. If no symbols are specified then the
644-
symbol code (see *S* below) must be present as last column in the
645-
input. If *S* is not used, a line connecting the data points will be
646-
drawn instead. To explicitly close polygons, use *L*. Select a fill
647-
with *G*. If *G* is set, *W* will control whether the polygon outline
648-
is drawn or not. If a symbol is selected, *G* and *W* determines the
649-
fill and outline/no outline, respectively.
646+
symbol code (see *symbol* below) must be present as last column in the
647+
input. If *symbol* is not used, a line connecting the data points will
648+
be drawn instead. To explicitly close polygons, use *close*. Select a
649+
fill with *color*. If *color* is set, *pen* will control whether the
650+
polygon outline is drawn or not. If a symbol is selected, *color* and
651+
*pen* determines the fill and outline/no outline, respectively.
650652
651653
Full option list at :gmt-docs:`plot.html`
652654
@@ -671,19 +673,33 @@ def plot(self, x=None, y=None, data=None, sizes=None, direction=None, **kwargs):
671673
depending on the style options chosen.
672674
{J}
673675
{R}
674-
A : bool or str
675-
``'[m|p|x|y]'``
676+
straight_lines : bool or str
677+
``[m|p|x|y]``.
676678
By default, geographic line segments are drawn as great circle
677-
arcs. To draw them as straight lines, use *A*.
679+
arcs. To draw them as straight lines, use *straight_lines*.
680+
Alternatively, add **m** to draw the line by first following a
681+
meridian, then a parallel. Or append **p** to start following a
682+
parallel, then a meridian. (This can be practical to draw a line
683+
along parallels, for example). For Cartesian data, points are
684+
simply connected, unless you append **x** or **y** to draw
685+
stair-case curves that whose first move is along *x* or *y*,
686+
respectively.
678687
{B}
679688
{CPT}
680-
D : str
681-
``'dx/dy'``: Offset the plot symbol or line locations by the given
682-
amounts dx/dy.
683-
E : bool or str
684-
``'[x|y|X|Y][+a][+cl|f][+n][+wcap][+ppen]'``.
685-
Draw symmetrical error bars.
689+
position : str
690+
``dx/dy``.
691+
Offset the plot symbol or line locations by the given amounts
692+
*dx/dy* [Default is no offset]. If *dy* is not given it is set
693+
equal to *dx*.
694+
error_bars : bool or str
695+
``[x|y|X|Y][+a][+cl|f][+n][+wcap][+ppen]``.
696+
Draw symmetrical error bars. Full documentation is at
697+
:gmt-docs:`plot.html#e`.
686698
{G}
699+
close : str
700+
``[+b|d|D][+xl|r|x0][+yl|r|y0][+ppen]``.
701+
Force closed polygons. Full documentation is at
702+
:gmt-docs:`plot.html#l`.
687703
no_clip : bool or str
688704
``'[c|r]'``.
689705
Do NOT clip symbols that fall outside map border [Default plots

0 commit comments

Comments
 (0)