@@ -606,47 +606,52 @@ def grdview(self, grid, **kwargs):
606
606
607
607
@fmt_docstring
608
608
@use_alias (
609
- R = "region" ,
610
- J = "projection" ,
609
+ A = "straight_line" ,
611
610
B = "frame" ,
612
- S = "style" ,
611
+ C = "cmap" ,
612
+ D = "offset" ,
613
+ E = "error_bar" ,
614
+ F = "connection" ,
613
615
G = "color" ,
616
+ I = "intensity" ,
617
+ J = "projection" ,
618
+ L = "close" ,
614
619
N = "no_clip" ,
615
- W = "pen" ,
616
- i = "columns" ,
617
- l = "label" ,
618
- C = "cmap" ,
620
+ R = "region" ,
621
+ S = "style" ,
619
622
U = "timestamp" ,
620
623
V = "verbose" ,
624
+ W = "pen" ,
621
625
X = "xshift" ,
622
626
Y = "yshift" ,
627
+ Z = "zvalue" ,
628
+ i = "columns" ,
629
+ l = "label" ,
623
630
p = "perspective" ,
624
631
t = "transparency" ,
625
632
)
626
633
@kwargs_to_strings (R = "sequence" , i = "sequence_comma" , p = "sequence" )
627
634
def plot (self , x = None , y = None , data = None , sizes = None , direction = None , ** kwargs ):
628
635
"""
629
- Plot lines, polygons, and symbols on maps.
630
-
631
- Used to be psxy.
636
+ Plot lines, polygons, and symbols in 2-D.
632
637
633
638
Takes a matrix, (x,y) pairs, or a file name as input and plots lines,
634
639
polygons, or symbols at those locations on a map.
635
640
636
641
Must provide either *data* or *x* and *y*.
637
642
638
- If providing data through *x* and *y*, *color* (G) can be a 1d array
639
- that will be mapped to a colormap.
643
+ If providing data through *x* and *y*, *color* can be a 1d array that
644
+ will be mapped to a colormap.
640
645
641
- If a symbol is selected and no symbol size given, then psxy will
646
+ If a symbol is selected and no symbol size given, then plot will
642
647
interpret the third column of the input data as symbol size. Symbols
643
648
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.
649
+ symbol code (see *style * below) must be present as last column in the
650
+ input. If *style * is not used, a line connecting the data points will
651
+ be drawn instead. To explicitly close polygons, use *close *. Select a
652
+ fill with *color *. If *color * is set, *pen * will control whether the
653
+ polygon outline is drawn or not. If a symbol is selected, *color * and
654
+ *pen* determines the fill and outline/no outline, respectively.
650
655
651
656
Full option list at :gmt-docs:`plot.html`
652
657
@@ -671,19 +676,69 @@ def plot(self, x=None, y=None, data=None, sizes=None, direction=None, **kwargs):
671
676
depending on the style options chosen.
672
677
{J}
673
678
{R}
674
- A : bool or str
675
- ``' [m|p|x|y]'``
679
+ straight_line : bool or str
680
+ ``[m|p|x|y]``.
676
681
By default, geographic line segments are drawn as great circle
677
- arcs. To draw them as straight lines, use *A*.
682
+ arcs. To draw them as straight lines, use *straight_line*.
683
+ Alternatively, add **m** to draw the line by first following a
684
+ meridian, then a parallel. Or append **p** to start following a
685
+ parallel, then a meridian. (This can be practical to draw a line
686
+ along parallels, for example). For Cartesian data, points are
687
+ simply connected, unless you append **x** or **y** to draw
688
+ stair-case curves that whose first move is along *x* or *y*,
689
+ respectively.
678
690
{B}
679
691
{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.
692
+ offset : str
693
+ ``dx/dy``.
694
+ Offset the plot symbol or line locations by the given amounts
695
+ *dx/dy* [Default is no offset]. If *dy* is not given it is set
696
+ equal to *dx*.
697
+ error_bar : bool or str
698
+ ``[x|y|X|Y][+a][+cl|f][+n][+wcap][+ppen]``.
699
+ Draw symmetrical error bars. Full documentation is at
700
+ :gmt-docs:`plot.html#e`.
701
+ connection : str
702
+ ``[c|n|r][a|f|s|r|refpoint]``.
703
+ Alter the way points are connected (by specifying a *scheme*) and
704
+ data are grouped (by specifying a *method*). Append one of three
705
+ line connection schemes:
706
+
707
+ - **c** : Draw continuous line segments for each group [Default].
708
+ - **r** : Draw line segments from a reference point reset for each
709
+ group.
710
+ - **n** : Draw networks of line segments between all points in
711
+ each group.
712
+
713
+ Optionally, append the one of four segmentation methods to define
714
+ the group:
715
+
716
+ - **a** : Ignore all segment headers, i.e., let all points belong
717
+ to a single group, and set group reference point to the very
718
+ first point of the first file.
719
+ - **f** : Consider all data in each file to be a single separate
720
+ group and reset the group reference point to the first point of
721
+ each group.
722
+ - **s** : Segment headers are honored so each segment is a group;
723
+ the group reference point is reset to the first point of each
724
+ incoming segment [Default].
725
+ - **r** : Same as **s**, but the group reference point is reset
726
+ after each record to the previous point (this method is only
727
+ available with the ``connection='r'`` scheme).
728
+
729
+ Instead of the codes **a**|**f**|**s**|**r** you may append the
730
+ coordinates of a *refpoint* which will serve as a fixed external
731
+ reference point for all groups.
686
732
{G}
733
+ intensity : float or bool
734
+ Provide an *intens* value (nominally in the -1 to +1 range) to
735
+ modulate the fill color by simulating illumination [None]. If
736
+ using ``intensity=True``, we will instead read *intens* from the
737
+ first data column after the symbol parameters (if given).
738
+ close : str
739
+ ``[+b|d|D][+xl|r|x0][+yl|r|y0][+ppen]``.
740
+ Force closed polygons. Full documentation is at
741
+ :gmt-docs:`plot.html#l`.
687
742
no_clip : bool or str
688
743
``'[c|r]'``.
689
744
Do NOT clip symbols that fall outside map border [Default plots
@@ -703,6 +758,15 @@ def plot(self, x=None, y=None, data=None, sizes=None, direction=None, **kwargs):
703
758
{U}
704
759
{V}
705
760
{XY}
761
+ zvalue : str
762
+ ``value|file``.
763
+ Instead of specifying a symbol or polygon fill and outline color
764
+ via **color** and **pen**, give both a *value* via **zvalue** and a
765
+ color lookup table via **cmap**. Alternatively, give the name of a
766
+ *file* with one z-value (read from the last column) for each
767
+ polygon in the input data. To apply it to the fill color, use
768
+ ``color='+z'``. To apply it to the pen color, append **+z** to
769
+ **pen**.
706
770
label : str
707
771
Add a legend entry for the symbol or line being plotted.
708
772
0 commit comments