diff --git a/pygmt/alias.py b/pygmt/alias.py index 5e17f04b3e7..f0c6cb452ed 100644 --- a/pygmt/alias.py +++ b/pygmt/alias.py @@ -226,8 +226,10 @@ class AliasSystem(UserDict): ... ], ... B=Alias(frame, name="frame"), ... D=Alias(repeat, name="repeat"), - ... c=Alias(panel, name="panel", sep=","), - ... ).merge(kwargs) + ... ).add_common( + ... c=panel, + ... ) + ... aliasdict.merge(kwargs) ... return build_arg_list(aliasdict) >>> func( ... "infile", @@ -268,6 +270,21 @@ def __init__(self, **kwargs): kwdict[option] = aliases._value super().__init__(kwdict) + def add_common(self, **kwargs): + """ + Add common parameters to the alias dictionary. + """ + for key, value in kwargs.items(): + match key: + case "c": + alias = Alias(value, name="panel", sep=",", size=2) + case _: + raise GMTValueError(key, description="common parameter") + self.aliasdict[key] = alias + if alias._value is not None: + self[key] = alias._value + return self + def merge(self, kwargs: Mapping[str, Any]): """ Update the dictionary with additional keyword arguments. diff --git a/pygmt/helpers/decorators.py b/pygmt/helpers/decorators.py index 1878938989e..43e9f05458c 100644 --- a/pygmt/helpers/decorators.py +++ b/pygmt/helpers/decorators.py @@ -261,7 +261,7 @@ :gmt-docs:`gmt.html#grd-inout-full` for the available modifiers. """, "panel": r""" - panel : bool, int, or list + panel Select a specific subplot panel. Only allowed when used in :meth:`Figure.subplot` mode. diff --git a/pygmt/src/basemap.py b/pygmt/src/basemap.py index c0638723b58..937c08a9d1a 100644 --- a/pygmt/src/basemap.py +++ b/pygmt/src/basemap.py @@ -18,13 +18,14 @@ Td="rose", Tm="compass", V="verbose", - c="panel", f="coltypes", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") -def basemap(self, projection=None, **kwargs): +@kwargs_to_strings(R="sequence", p="sequence") +def basemap( + self, projection=None, panel: int | tuple[int, int] | bool = False, **kwargs +): r""" Plot base maps and frames. @@ -40,6 +41,7 @@ def basemap(self, projection=None, **kwargs): {aliases} - J = projection + - c = panel Parameters ---------- @@ -84,8 +86,13 @@ def basemap(self, projection=None, **kwargs): {transparency} """ self._activate_figure() + aliasdict = AliasSystem( J=Alias(projection, name="projection"), - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) + with Session() as lib: lib.call_module(module="basemap", args=build_arg_list(aliasdict)) diff --git a/pygmt/src/coast.py b/pygmt/src/coast.py index e7715c83daf..3ddeec22aff 100644 --- a/pygmt/src/coast.py +++ b/pygmt/src/coast.py @@ -33,17 +33,17 @@ S="water", V="verbose", W="shorelines", - c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", p="sequence") def coast( self, projection=None, resolution: Literal[ "auto", "full", "high", "intermediate", "low", "crude", None ] = None, + panel: int | tuple[int, int] | bool = False, **kwargs, ): r""" @@ -68,6 +68,7 @@ def coast( {aliases} - D = resolution - J = projection + - c = panel Parameters ---------- @@ -227,7 +228,10 @@ def coast( }, ), J=Alias(projection, name="projection"), - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) with Session() as lib: lib.call_module(module="coast", args=build_arg_list(aliasdict)) diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index ab9bf476851..ae32c3e3691 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -23,14 +23,13 @@ V="verbose", W="scale", Z="zfile", - c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings( - R="sequence", G="sequence", I="sequence", c="sequence_comma", p="sequence" -) -def colorbar(self, projection=None, **kwargs): +@kwargs_to_strings(R="sequence", G="sequence", I="sequence", p="sequence") +def colorbar( + self, projection=None, panel: int | tuple[int, int] | bool = False, **kwargs +): r""" Plot gray scale or color scale bar. @@ -46,6 +45,7 @@ def colorbar(self, projection=None, **kwargs): {aliases} - J = projection + - c = panel Parameters ---------- @@ -149,6 +149,10 @@ def colorbar(self, projection=None, **kwargs): aliasdict = AliasSystem( J=Alias(projection, name="projection"), - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) + with Session() as lib: lib.call_module(module="colorbar", args=build_arg_list(aliasdict)) diff --git a/pygmt/src/contour.py b/pygmt/src/contour.py index 61e69e127c4..095937070c7 100644 --- a/pygmt/src/contour.py +++ b/pygmt/src/contour.py @@ -27,7 +27,6 @@ V="verbose", W="pen", b="binary", - c="panel", d="nodata", e="find", f="coltypes", @@ -37,7 +36,7 @@ p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", i="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", i="sequence_comma", p="sequence") def contour( self, data: PathLike | TableLike | None = None, @@ -45,6 +44,7 @@ def contour( y=None, z=None, projection=None, + panel: int | tuple[int, int] | bool = False, **kwargs, ): r""" @@ -59,6 +59,7 @@ def contour( {aliases} - J = projection + - c = panel Parameters ---------- @@ -155,7 +156,10 @@ def contour( aliasdict = AliasSystem( J=Alias(projection, name="projection"), - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) with Session() as lib: with lib.virtualfile_in( diff --git a/pygmt/src/grdcontour.py b/pygmt/src/grdcontour.py index a734c56942d..0e75a9fa76e 100644 --- a/pygmt/src/grdcontour.py +++ b/pygmt/src/grdcontour.py @@ -32,13 +32,18 @@ V="verbose", W="pen", l="label", - c="panel", f="coltypes", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", L="sequence", c="sequence_comma", p="sequence") -def grdcontour(self, grid: PathLike | xr.DataArray, projection=None, **kwargs): +@kwargs_to_strings(R="sequence", L="sequence", p="sequence") +def grdcontour( + self, + grid: PathLike | xr.DataArray, + projection=None, + panel: int | tuple[int, int] | bool = False, + **kwargs, +): r""" Make contour map using a grid. @@ -48,6 +53,7 @@ def grdcontour(self, grid: PathLike | xr.DataArray, projection=None, **kwargs): {aliases} - J = projection + - c = panel Parameters ---------- @@ -154,7 +160,10 @@ def grdcontour(self, grid: PathLike | xr.DataArray, projection=None, **kwargs): aliasdict = AliasSystem( J=Alias(projection, name="projection"), - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) with Session() as lib: with lib.virtualfile_in(check_kind="raster", data=grid) as vingrd: diff --git a/pygmt/src/grdimage.py b/pygmt/src/grdimage.py index e79ae5af931..8b7398c5260 100644 --- a/pygmt/src/grdimage.py +++ b/pygmt/src/grdimage.py @@ -31,14 +31,19 @@ R="region", V="verbose", n="interpolation", - c="panel", f="coltypes", p="perspective", t="transparency", x="cores", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") -def grdimage(self, grid: PathLike | xr.DataArray, projection=None, **kwargs): +@kwargs_to_strings(R="sequence", p="sequence") +def grdimage( + self, + grid: PathLike | xr.DataArray, + projection=None, + panel: int | tuple[int, int] | bool = False, + **kwargs, +): r""" Project and plot grids or images. @@ -74,6 +79,7 @@ def grdimage(self, grid: PathLike | xr.DataArray, projection=None, **kwargs): {aliases} - J = projection + - c = panel Parameters ---------- @@ -169,7 +175,10 @@ def grdimage(self, grid: PathLike | xr.DataArray, projection=None, **kwargs): aliasdict = AliasSystem( J=Alias(projection, name="projection"), - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) with Session() as lib: with ( diff --git a/pygmt/src/grdview.py b/pygmt/src/grdview.py index 670a12e99af..6035ecf5e42 100644 --- a/pygmt/src/grdview.py +++ b/pygmt/src/grdview.py @@ -26,14 +26,19 @@ Wf="facadepen", I="shading", V="verbose", - c="panel", f="coltypes", n="interpolation", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") -def grdview(self, grid: PathLike | xr.DataArray, projection=None, **kwargs): +@kwargs_to_strings(R="sequence", p="sequence") +def grdview( + self, + grid: PathLike | xr.DataArray, + projection=None, + panel: int | tuple[int, int] | bool = False, + **kwargs, +): r""" Create 3-D perspective image or surface mesh from a grid. @@ -47,6 +52,7 @@ def grdview(self, grid: PathLike | xr.DataArray, projection=None, **kwargs): {aliases} - J = projection + - c = panel Parameters ---------- @@ -145,7 +151,10 @@ def grdview(self, grid: PathLike | xr.DataArray, projection=None, **kwargs): aliasdict = AliasSystem( J=Alias(projection, name="projection"), - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) with Session() as lib: with ( diff --git a/pygmt/src/histogram.py b/pygmt/src/histogram.py index d7b8057594a..190706a8b26 100644 --- a/pygmt/src/histogram.py +++ b/pygmt/src/histogram.py @@ -27,7 +27,6 @@ W="pen", Z="histtype", b="binary", - c="panel", d="nodata", e="find", h="header", @@ -37,10 +36,14 @@ t="transparency", w="wrap", ) -@kwargs_to_strings( - R="sequence", T="sequence", c="sequence_comma", i="sequence_comma", p="sequence" -) -def histogram(self, data: PathLike | TableLike, projection=None, **kwargs): +@kwargs_to_strings(R="sequence", T="sequence", i="sequence_comma", p="sequence") +def histogram( + self, + data: PathLike | TableLike, + projection=None, + panel: int | tuple[int, int] | bool = False, + **kwargs, +): r""" Calculate and plot histograms. @@ -48,6 +51,7 @@ def histogram(self, data: PathLike | TableLike, projection=None, **kwargs): {aliases} - J = projection + - c = panel Parameters ---------- @@ -140,7 +144,10 @@ def histogram(self, data: PathLike | TableLike, projection=None, **kwargs): aliasdict = AliasSystem( J=Alias(projection, name="projection"), - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) with Session() as lib: with lib.virtualfile_in(check_kind="vector", data=data) as vintbl: diff --git a/pygmt/src/image.py b/pygmt/src/image.py index 8aae0de9bd9..2a7ce422f43 100644 --- a/pygmt/src/image.py +++ b/pygmt/src/image.py @@ -16,12 +16,17 @@ M="monochrome", R="region", V="verbose", - c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") -def image(self, imagefile: PathLike, projection=None, **kwargs): +@kwargs_to_strings(R="sequence", p="sequence") +def image( + self, + imagefile: PathLike, + projection=None, + panel: int | tuple[int, int] | bool = False, + **kwargs, +): r""" Plot raster or EPS images. @@ -32,6 +37,7 @@ def image(self, imagefile: PathLike, projection=None, **kwargs): {aliases} - J = projection + - c = panel Parameters ---------- @@ -73,7 +79,10 @@ def image(self, imagefile: PathLike, projection=None, **kwargs): aliasdict = AliasSystem( J=Alias(projection, name="projection"), - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) with Session() as lib: lib.call_module( diff --git a/pygmt/src/legend.py b/pygmt/src/legend.py index c093f13f046..e0e819adcfc 100644 --- a/pygmt/src/legend.py +++ b/pygmt/src/legend.py @@ -24,17 +24,17 @@ D="position", F="box", V="verbose", - c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", p="sequence") def legend( self, spec: PathLike | io.StringIO | None = None, projection=None, position="JTR+jTR+o0.2c", box="+gwhite+p1p", + panel: int | tuple[int, int] | bool = False, **kwargs, ): r""" @@ -50,6 +50,7 @@ def legend( {aliases} - J = projection + - c = panel Parameters ---------- @@ -101,7 +102,10 @@ def legend( aliasdict = AliasSystem( J=Alias(projection, name="projection"), - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) with Session() as lib: with lib.virtualfile_in(data=spec, required=False) as vintbl: diff --git a/pygmt/src/logo.py b/pygmt/src/logo.py index a5000d41803..33f36a77a3a 100644 --- a/pygmt/src/logo.py +++ b/pygmt/src/logo.py @@ -14,11 +14,10 @@ F="box", S="style", V="verbose", - c="panel", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") -def logo(self, projection=None, **kwargs): +@kwargs_to_strings(R="sequence", p="sequence") +def logo(self, projection=None, panel: int | tuple[int, int] | bool = False, **kwargs): r""" Plot the GMT logo. @@ -31,6 +30,7 @@ def logo(self, projection=None, **kwargs): {aliases} - J = projection + - c = panel Parameters ---------- @@ -59,7 +59,10 @@ def logo(self, projection=None, **kwargs): aliasdict = AliasSystem( J=Alias(projection, name="projection"), - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) with Session() as lib: lib.call_module(module="logo", args=build_arg_list(aliasdict)) diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index bba928d600e..bec30c9d6f8 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -129,11 +129,10 @@ def _auto_offset(spec) -> bool: T="nodal", V="verbose", W="pen", - c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", p="sequence") def meca( # noqa: PLR0913 self, spec: PathLike | TableLike, @@ -147,6 +146,7 @@ def meca( # noqa: PLR0913 plot_latitude: float | Sequence[float] | None = None, event_name: str | Sequence[str] | None = None, projection=None, + panel: int | tuple[int, int] | bool = False, **kwargs, ): r""" @@ -203,6 +203,7 @@ def meca( # noqa: PLR0913 {aliases} - J = projection - S = scale/convention/component + - c = panel Parameters ---------- @@ -367,7 +368,10 @@ def meca( # noqa: PLR0913 aliasdict = AliasSystem( J=Alias(projection, name="projection"), - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) with Session() as lib: with lib.virtualfile_in(check_kind="vector", data=spec) as vintbl: diff --git a/pygmt/src/plot.py b/pygmt/src/plot.py index 86270b2af21..8f2d5b521eb 100644 --- a/pygmt/src/plot.py +++ b/pygmt/src/plot.py @@ -38,7 +38,6 @@ Z="zvalue", a="aspatial", b="binary", - c="panel", d="nodata", e="find", f="coltypes", @@ -50,7 +49,7 @@ t="transparency", w="wrap", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", i="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", i="sequence_comma", p="sequence") def plot( # noqa: PLR0912 self, data: PathLike | TableLike | None = None, @@ -61,6 +60,7 @@ def plot( # noqa: PLR0912 direction=None, straight_line: bool | Literal["x", "y"] = False, # noqa: ARG001 projection=None, + panel: int | tuple[int, int] | bool = False, **kwargs, ): r""" @@ -88,6 +88,7 @@ def plot( # noqa: PLR0912 {aliases} - J = projection + - c = panel Parameters ---------- @@ -285,7 +286,10 @@ def plot( # noqa: PLR0912 aliasdict = AliasSystem( J=Alias(projection, name="projection"), - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) with Session() as lib: with lib.virtualfile_in(check_kind="vector", data=data) as vintbl: diff --git a/pygmt/src/plot3d.py b/pygmt/src/plot3d.py index fed67872700..d6791ef1bfd 100644 --- a/pygmt/src/plot3d.py +++ b/pygmt/src/plot3d.py @@ -39,7 +39,6 @@ Z="zvalue", a="aspatial", b="binary", - c="panel", d="nodata", e="find", f="coltypes", @@ -51,8 +50,8 @@ t="transparency", w="wrap", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", i="sequence_comma", p="sequence") -def plot3d( # noqa: PLR0912 +@kwargs_to_strings(R="sequence", i="sequence_comma", p="sequence") +def plot3d( # noqa: PLR0912, PLR0913 self, data: PathLike | TableLike | None = None, x=None, @@ -63,6 +62,7 @@ def plot3d( # noqa: PLR0912 direction=None, straight_line: bool | Literal["x", "y"] = False, # noqa: ARG001 projection=None, + panel: int | tuple[int, int] | bool = False, **kwargs, ): r""" @@ -90,6 +90,7 @@ def plot3d( # noqa: PLR0912 {aliases} - J = projection + - c = panel Parameters ---------- @@ -264,7 +265,10 @@ def plot3d( # noqa: PLR0912 aliasdict = AliasSystem( J=Alias(projection, name="projection"), - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) with Session() as lib: with lib.virtualfile_in(check_kind="vector", data=data, mincols=3) as vintbl: diff --git a/pygmt/src/rose.py b/pygmt/src/rose.py index c99e0ecd09a..baf8af78b1e 100644 --- a/pygmt/src/rose.py +++ b/pygmt/src/rose.py @@ -3,13 +3,9 @@ """ from pygmt._typing import PathLike, TableLike +from pygmt.alias import AliasSystem from pygmt.clib import Session -from pygmt.helpers import ( - build_arg_list, - fmt_docstring, - kwargs_to_strings, - use_alias, -) +from pygmt.helpers import build_arg_list, fmt_docstring, kwargs_to_strings, use_alias @fmt_docstring @@ -37,14 +33,18 @@ e="find", h="header", i="incols", - c="panel", p="perspective", t="transparency", w="wrap", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", i="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", i="sequence_comma", p="sequence") def rose( - self, data: PathLike | TableLike | None = None, length=None, azimuth=None, **kwargs + self, + data: PathLike | TableLike | None = None, + length=None, + azimuth=None, + panel: int | tuple[int, int] | bool = False, + **kwargs, ): """ Plot a polar histogram (rose, sector, windrose diagrams). @@ -62,6 +62,7 @@ def rose( Full GMT docs at :gmt-docs:`rose.html`. {aliases} + - c = panel Parameters ---------- @@ -201,6 +202,11 @@ def rose( """ self._activate_figure() + aliasdict = AliasSystem().add_common( + c=panel, + ) + aliasdict.merge(kwargs) + with Session() as lib: with lib.virtualfile_in( check_kind="vector", data=data, x=length, y=azimuth diff --git a/pygmt/src/solar.py b/pygmt/src/solar.py index 99a80243c64..83be1b41a71 100644 --- a/pygmt/src/solar.py +++ b/pygmt/src/solar.py @@ -20,16 +20,16 @@ R="region", V="verbose", W="pen", - c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", p="sequence") def solar( self, terminator: Literal["astronomical", "civil", "day_night", "nautical"] = "day_night", terminator_datetime=None, projection=None, + panel: int | tuple[int, int] | bool = False, **kwargs, ): r""" @@ -43,6 +43,7 @@ def solar( {aliases} - J = projection - T = terminator, **+d**: terminator_datetime + - c = panel Parameters ---------- @@ -124,7 +125,10 @@ def solar( ), Alias(datetime_string, name="terminator_datetime", prefix="+d"), ], - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) with Session() as lib: lib.call_module(module="solar", args=build_arg_list(aliasdict)) diff --git a/pygmt/src/ternary.py b/pygmt/src/ternary.py index cd95146ea6f..3dfdf130e93 100644 --- a/pygmt/src/ternary.py +++ b/pygmt/src/ternary.py @@ -20,17 +20,17 @@ S="style", V="verbose", W="pen", - c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", p="sequence") def ternary( self, data: PathLike | TableLike, alabel: str | None = None, blabel: str | None = None, clabel: str | None = None, + panel: int | tuple[int, int] | bool = False, **kwargs, ): r""" @@ -48,6 +48,7 @@ def ternary( {aliases} - L = alabel/blabel/clabel + - c = panel Parameters ---------- @@ -91,7 +92,10 @@ def ternary( aliasdict = AliasSystem( L=Alias(labels, name="alabel/blabel/clabel", sep="/", size=3), - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) # TODO(GMT>=6.5.0): Remove the patch for upstream bug fixed in GMT 6.5.0. # See https://github.com/GenericMappingTools/pygmt/pull/2138 diff --git a/pygmt/src/text.py b/pygmt/src/text.py index ac40186d4ba..6ecc72e58d7 100644 --- a/pygmt/src/text.py +++ b/pygmt/src/text.py @@ -32,7 +32,6 @@ V="verbose", W="pen", a="aspatial", - c="panel", e="find", f="coltypes", h="header", @@ -41,8 +40,8 @@ t="transparency", w="wrap", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence") -def text_( # noqa: PLR0912 +@kwargs_to_strings(R="sequence", p="sequence") +def text_( # noqa: PLR0912, PLR0913, PLR0915 self, textfiles: PathLike | TableLike | None = None, x=None, @@ -53,6 +52,7 @@ def text_( # noqa: PLR0912 font=None, justify: bool | None | AnchorCode | Sequence[AnchorCode] = None, projection=None, + panel: int | tuple[int, int] | bool = False, **kwargs, ): r""" @@ -74,6 +74,7 @@ def text_( # noqa: PLR0912 {aliases} - F = **+a**: angle, **+c**: position, **+j**: justify, **+f**: font - J = projection + - c = panel Parameters ---------- @@ -266,7 +267,10 @@ def text_( # noqa: PLR0912 aliasdict = AliasSystem( J=Alias(projection, name="projection"), - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) with Session() as lib: with lib.virtualfile_in( diff --git a/pygmt/src/tilemap.py b/pygmt/src/tilemap.py index 73d61ca7dac..316bc591b58 100644 --- a/pygmt/src/tilemap.py +++ b/pygmt/src/tilemap.py @@ -26,11 +26,10 @@ Q="nan_transparent", # R="region", V="verbose", - c="panel", p="perspective", t="transparency", ) -@kwargs_to_strings(c="sequence_comma", p="sequence") # R="sequence", +@kwargs_to_strings(p="sequence") # R="sequence", def tilemap( self, region: list, @@ -41,6 +40,7 @@ def tilemap( max_retries: int = 2, zoom_adjust: int | None = None, projection=None, + panel: int | tuple[int, int] | bool = False, **kwargs, ): r""" @@ -58,6 +58,7 @@ def tilemap( {aliases} - J = projection + - c = panel Parameters ---------- @@ -129,7 +130,10 @@ def tilemap( aliasdict = AliasSystem( J=Alias(projection, name="projection"), - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) with Session() as lib: with lib.virtualfile_in(check_kind="raster", data=raster) as vingrd: diff --git a/pygmt/src/velo.py b/pygmt/src/velo.py index 39efb5842f4..fb4fc2f0448 100644 --- a/pygmt/src/velo.py +++ b/pygmt/src/velo.py @@ -33,7 +33,6 @@ V="verbose", W="pen", Z="zvalue", - c="panel", d="nodata", e="find", h="header", @@ -41,8 +40,14 @@ p="perspective", t="transparency", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", i="sequence_comma", p="sequence") -def velo(self, data: PathLike | TableLike | None = None, projection=None, **kwargs): +@kwargs_to_strings(R="sequence", i="sequence_comma", p="sequence") +def velo( + self, + data: PathLike | TableLike | None = None, + projection=None, + panel: int | tuple[int, int] | bool = False, + **kwargs, +): r""" Plot velocity vectors, crosses, anisotropy bars, and wedges. @@ -59,6 +64,7 @@ def velo(self, data: PathLike | TableLike | None = None, projection=None, **kwar {aliases} - J = projection + - c = panel Parameters ---------- @@ -259,7 +265,10 @@ def velo(self, data: PathLike | TableLike | None = None, projection=None, **kwar aliasdict = AliasSystem( J=Alias(projection, name="projection"), - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) with Session() as lib: with lib.virtualfile_in(check_kind="vector", data=data) as vintbl: diff --git a/pygmt/src/wiggle.py b/pygmt/src/wiggle.py index 97731ec1f6d..5f973625400 100644 --- a/pygmt/src/wiggle.py +++ b/pygmt/src/wiggle.py @@ -45,7 +45,6 @@ def _parse_fills(fillpositive, fillnegative): W="pen", Z="scale", b="binary", - c="panel", d="nodata", e="find", f="coltypes", @@ -56,7 +55,7 @@ def _parse_fills(fillpositive, fillnegative): t="transparency", w="wrap", ) -@kwargs_to_strings(R="sequence", c="sequence_comma", i="sequence_comma", p="sequence") +@kwargs_to_strings(R="sequence", i="sequence_comma", p="sequence") def wiggle( self, data: PathLike | TableLike | None = None, @@ -66,6 +65,7 @@ def wiggle( fillpositive=None, fillnegative=None, projection=None, + panel: int | tuple[int, int] | bool = False, **kwargs, ): r""" @@ -81,6 +81,7 @@ def wiggle( {aliases} - G = **+p**: fillpositive, **+n**: fillnegative - J = projection + - c = panel Parameters ---------- @@ -133,7 +134,10 @@ def wiggle( aliasdict = AliasSystem( J=Alias(projection, name="projection"), G=Alias(_fills, name="fillpositive/fillnegative"), - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) with Session() as lib: with lib.virtualfile_in(