diff --git a/pygmt/helpers/decorators.py b/pygmt/helpers/decorators.py index f40800d367a..37d7797ce01 100644 --- a/pygmt/helpers/decorators.py +++ b/pygmt/helpers/decorators.py @@ -60,6 +60,15 @@ Shift plot origin in y-direction. Full documentation is at :gmt-docs:`gmt.html#xy-full`. """, + "c": r"""panel : int or list or bool + [*row*\ ,\ *col*\|\ *index*]. + Selects a specific subplot panel. Only allowed when in subplot + mode. Use ``panel=True`` to advance to the next panel in the + selected order. Instead of *row,col* you may also give a scalar + value *index* which depends on the order you set via ``autolabel`` + when the subplot was defined. **Note**: *row*, *col*, and *index* + all start at 0. + """, "j": """\ distcalc : str ``e|f|g``. diff --git a/pygmt/src/basemap.py b/pygmt/src/basemap.py index 60fe1ddb217..678540c48f7 100644 --- a/pygmt/src/basemap.py +++ b/pygmt/src/basemap.py @@ -27,10 +27,11 @@ V="verbose", X="xshift", Y="yshift", + c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", p="sequence") +@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") def basemap(self, **kwargs): """ Plot base maps and frames for the figure. @@ -66,13 +67,14 @@ def basemap(self, **kwargs): {U} {V} {XY} + {c} {p} {t} """ kwargs = self._preprocess(**kwargs) # pylint: disable=protected-access - if not args_in_kwargs(args=["B", "L", "Td", "Tm"], kwargs=kwargs): + if not args_in_kwargs(args=["B", "L", "Td", "Tm", "c"], kwargs=kwargs): raise GMTInvalidInput( - "At least one of frame, map_scale, compass, or rose must be specified." + "At least one of frame, map_scale, compass, rose, or panel must be specified." ) with Session() as lib: lib.call_module("basemap", build_arg_string(kwargs)) diff --git a/pygmt/src/coast.py b/pygmt/src/coast.py index 21dccb52599..38f3719d47a 100644 --- a/pygmt/src/coast.py +++ b/pygmt/src/coast.py @@ -32,10 +32,11 @@ V="verbose", X="xshift", Y="yshift", + c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", p="sequence") +@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") def coast(self, **kwargs): r""" Plot continents, shorelines, rivers, and borders on maps @@ -182,6 +183,7 @@ def coast(self, **kwargs): the segment headers via **-Z**\ *code* settings.To apply different settings to different countries, pass a list of string arguments. {XY} + {c} {p} {t} {V} diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index 571dc8e760e..f523ab63609 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -20,10 +20,13 @@ V="verbose", X="xshift", Y="yshift", + c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", G="sequence", I="sequence", p="sequence") +@kwargs_to_strings( + R="sequence", G="sequence", I="sequence", c="sequence_comma", p="sequence" +) def colorbar(self, **kwargs): """ Plot a gray or color scale-bar on maps. @@ -94,6 +97,7 @@ def colorbar(self, **kwargs): illumination. {V} {XY} + {c} {p} {t} """ diff --git a/pygmt/src/contour.py b/pygmt/src/contour.py index 2ad34a366e0..a782d8d814b 100644 --- a/pygmt/src/contour.py +++ b/pygmt/src/contour.py @@ -30,10 +30,11 @@ V="verbose", X="xshift", Y="yshift", + c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", i="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", c="sequence_comma", i="sequence_comma", p="sequence") def contour(self, x=None, y=None, z=None, data=None, **kwargs): """ Contour table data by direct triangulation. @@ -92,6 +93,7 @@ def contour(self, x=None, y=None, z=None, data=None, **kwargs): separator for the two labels instead. {V} {XY} + {c} {p} {t} """ diff --git a/pygmt/src/grdcontour.py b/pygmt/src/grdcontour.py index 9b839f931a8..932e5b7a89e 100644 --- a/pygmt/src/grdcontour.py +++ b/pygmt/src/grdcontour.py @@ -30,10 +30,13 @@ l="label", X="xshift", Y="yshift", + c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", L="sequence", A="sequence_plus", p="sequence") +@kwargs_to_strings( + R="sequence", L="sequence", A="sequence_plus", c="sequence_comma", p="sequence" +) def grdcontour(self, grid, **kwargs): """ Convert grids or images to contours and plot them on maps. @@ -87,6 +90,7 @@ def grdcontour(self, grid, **kwargs): {V} {W} {XY} + {c} label : str Add a legend entry for the contour being plotted. Normally, the annotated contour is selected for the legend. You can select the diff --git a/pygmt/src/grdimage.py b/pygmt/src/grdimage.py index f0cb2bd5a6a..9658164677b 100644 --- a/pygmt/src/grdimage.py +++ b/pygmt/src/grdimage.py @@ -32,11 +32,12 @@ X="xshift", Y="yshift", n="interpolation", + c="panel", p="perspective", t="transparency", x="cores", ) -@kwargs_to_strings(R="sequence", p="sequence") +@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") def grdimage(self, grid, **kwargs): """ Project and plot grids or images. @@ -151,6 +152,7 @@ def grdimage(self, grid, **kwargs): {R} {V} {XY} + {c} {n} {p} {t} diff --git a/pygmt/src/grdview.py b/pygmt/src/grdview.py index 63ca411be34..77127e343d9 100644 --- a/pygmt/src/grdview.py +++ b/pygmt/src/grdview.py @@ -33,10 +33,11 @@ V="verbose", X="xshift", Y="yshift", + c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", p="sequence") +@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") def grdview(self, grid, **kwargs): """ Create 3-D perspective image or surface mesh from a grid. @@ -111,6 +112,7 @@ def grdview(self, grid, **kwargs): {V} {XY} + {c} {p} {t} """ diff --git a/pygmt/src/image.py b/pygmt/src/image.py index 72c5f7949d5..9864422a120 100644 --- a/pygmt/src/image.py +++ b/pygmt/src/image.py @@ -15,10 +15,11 @@ V="verbose", X="xshift", Y="yshift", + c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", p="sequence") +@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") def image(self, imagefile, **kwargs): """ Place images or EPS files on maps. @@ -53,6 +54,7 @@ def image(self, imagefile, **kwargs): YIQ-transformation. {V} {XY} + {c} {p} {t} """ diff --git a/pygmt/src/legend.py b/pygmt/src/legend.py index c8d3fcef8e3..cd3e9362f12 100644 --- a/pygmt/src/legend.py +++ b/pygmt/src/legend.py @@ -22,10 +22,11 @@ V="verbose", X="xshift", Y="yshift", + c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", p="sequence") +@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") def legend(self, spec=None, position="JTR+jTR+o0.2c", box="+gwhite+p1p", **kwargs): """ Plot legends on maps. @@ -61,6 +62,7 @@ def legend(self, spec=None, position="JTR+jTR+o0.2c", box="+gwhite+p1p", **kwarg using a 1 point black pen and adds a white background. {V} {XY} + {c} {p} {t} """ diff --git a/pygmt/src/logo.py b/pygmt/src/logo.py index c2f29fae2d1..af0d60c0754 100644 --- a/pygmt/src/logo.py +++ b/pygmt/src/logo.py @@ -17,9 +17,10 @@ V="verbose", X="xshift", Y="yshift", + c="panel", t="transparency", ) -@kwargs_to_strings(R="sequence", p="sequence") +@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") def logo(self, **kwargs): """ Plot the GMT logo. @@ -54,6 +55,7 @@ def logo(self, **kwargs): {U} {V} {XY} + {c} {t} """ kwargs = self._preprocess(**kwargs) # pylint: disable=protected-access diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index f50933facf1..0fe68b8c8b9 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -26,10 +26,11 @@ V="verbose", X="xshift", Y="yshift", + c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", p="sequence") +@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") def meca( self, # pylint: disable=unused-argument spec, @@ -124,6 +125,7 @@ def meca( {B} {V} {XY} + {c} {p} {t} """ diff --git a/pygmt/src/plot.py b/pygmt/src/plot.py index 0324e1c25d0..0ec3d0bc89a 100644 --- a/pygmt/src/plot.py +++ b/pygmt/src/plot.py @@ -38,10 +38,11 @@ Z="zvalue", i="columns", l="label", + c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", i="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", c="sequence_comma", i="sequence_comma", p="sequence") def plot(self, x=None, y=None, data=None, sizes=None, direction=None, **kwargs): """ Plot lines, polygons, and symbols in 2-D. @@ -178,6 +179,7 @@ def plot(self, x=None, y=None, data=None, sizes=None, direction=None, **kwargs): polygon in the input data. To apply it to the fill color, use ``color='+z'``. To apply it to the pen color, append **+z** to **pen**. + {c} columns : str or 1d array Choose which columns are x, y, color, and size, respectively if input is provided via *data*. E.g. ``columns = [0, 1]`` or diff --git a/pygmt/src/plot3d.py b/pygmt/src/plot3d.py index d828d85c6c3..682cd7494a4 100644 --- a/pygmt/src/plot3d.py +++ b/pygmt/src/plot3d.py @@ -38,10 +38,11 @@ Z="zvalue", i="columns", l="label", + c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", i="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", c="sequence_comma", i="sequence_comma", p="sequence") def plot3d( self, x=None, y=None, z=None, data=None, sizes=None, direction=None, **kwargs ): @@ -150,6 +151,7 @@ def plot3d( polygon in the input data. To apply it to the fill color, use ``color='+z'``. To apply it to the pen color, append **+z** to **pen**. + {c} label : str Add a legend entry for the symbol or line being plotted. {p} diff --git a/pygmt/src/text.py b/pygmt/src/text.py index 6bcf7e0989e..0fa0a9698a8 100644 --- a/pygmt/src/text.py +++ b/pygmt/src/text.py @@ -28,6 +28,7 @@ W="pen", X="xshift", Y="yshift", + c="panel", p="perspective", t="transparency", ) @@ -37,6 +38,7 @@ angle="sequence_comma", font="sequence_comma", justify="sequence_comma", + c="sequence_comma", p="sequence", ) def text_( @@ -140,6 +142,7 @@ def text_( clip]. {V} {XY} + {c} {p} {t} """