diff --git a/pygmt/alias.py b/pygmt/alias.py index 22c2ac061f8..7e1344c104d 100644 --- a/pygmt/alias.py +++ b/pygmt/alias.py @@ -307,6 +307,8 @@ def add_common(self, **kwargs): """ for key, value in kwargs.items(): match key: + case "B": + alias = Alias(value, name="frame") case "J": alias = Alias(value, name="projection") case "R": diff --git a/pygmt/src/basemap.py b/pygmt/src/basemap.py index 6b8fce428e3..aceed955e1f 100644 --- a/pygmt/src/basemap.py +++ b/pygmt/src/basemap.py @@ -14,7 +14,6 @@ @use_alias( Jz="zscale", JZ="zsize", - B="frame", L="map_scale", F="box", Td="rose", @@ -26,6 +25,7 @@ def basemap( self, projection: str | None = None, + frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -47,6 +47,7 @@ def basemap( Full GMT docs at :gmt-docs:`basemap.html`. {aliases} + - B = frame - J = projection - R = region - V = verbose @@ -98,6 +99,7 @@ def basemap( self._activate_figure() aliasdict = AliasSystem().add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/coast.py b/pygmt/src/coast.py index 2b7f4e1c3be..fa2884c005c 100644 --- a/pygmt/src/coast.py +++ b/pygmt/src/coast.py @@ -23,7 +23,6 @@ @fmt_docstring @use_alias( A="area_thresh", - B="frame", C="lakes", E="dcw", G="land", @@ -37,11 +36,12 @@ @kwargs_to_strings(p="sequence") def coast( self, - projection: str | None = None, resolution: Literal[ "auto", "full", "high", "intermediate", "low", "crude", None ] = None, box: Box | bool = False, + projection: str | None = None, + frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -69,6 +69,7 @@ def coast( Full GMT docs at :gmt-docs:`coast.html`. {aliases} + - B = frame - D = resolution - F = box - J = projection @@ -223,6 +224,7 @@ def coast( ), F=Alias(box, name="box"), ).add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index 06d4455ba24..93f1b43066c 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -15,7 +15,6 @@ @fmt_docstring @use_alias( - B="frame", C="cmap", D="position", G="truncate", @@ -31,6 +30,7 @@ def colorbar( shading: float | Sequence[float] | bool = False, projection: str | None = None, box: Box | bool = False, + frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -63,6 +63,7 @@ def colorbar( Full GMT docs at :gmt-docs:`colorbar.html`. {aliases} + - B = frame - F = box - I = shading - J = projection @@ -167,6 +168,7 @@ def colorbar( F=Alias(box, name="box"), I=Alias(shading, name="shading", sep="/", size=2), ).add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/contour.py b/pygmt/src/contour.py index 46a2ae857ae..fcce565012e 100644 --- a/pygmt/src/contour.py +++ b/pygmt/src/contour.py @@ -20,7 +20,6 @@ @fmt_docstring @use_alias( A="annotation", - B="frame", C="levels", G="label_placement", L="triangular_mesh_pen", @@ -44,6 +43,7 @@ def contour( # noqa: PLR0913 z=None, no_clip: bool = False, projection: str | None = None, + frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -62,6 +62,7 @@ def contour( # noqa: PLR0913 Full GMT docs at :gmt-docs:`contour.html`. {aliases} + - B = frame - J = projection - N = no_clip - R = region @@ -165,6 +166,7 @@ def contour( # noqa: PLR0913 aliasdict = AliasSystem( N=Alias(no_clip, name="no_clip"), ).add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/grdcontour.py b/pygmt/src/grdcontour.py index ccfb8f448aa..f0511ddbcb0 100644 --- a/pygmt/src/grdcontour.py +++ b/pygmt/src/grdcontour.py @@ -25,7 +25,6 @@ @deprecate_parameter("interval", "levels", "v0.12.0", remove_version="v0.16.0") @use_alias( A="annotation", - B="frame", C="levels", G="label_placement", L="limit", @@ -41,6 +40,7 @@ def grdcontour( self, grid: PathLike | xr.DataArray, projection: str | None = None, + frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -56,6 +56,7 @@ def grdcontour( Full GMT docs at :gmt-docs:`grdcontour.html`. {aliases} + - B = frame - J = projection - R = region - V = verbose @@ -166,6 +167,7 @@ def grdcontour( kwargs[arg] = ",".join(f"{item}" for item in kwargs[arg]) aliasdict = AliasSystem().add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/grdimage.py b/pygmt/src/grdimage.py index 6a2e15c1b7c..a0d1c52d22d 100644 --- a/pygmt/src/grdimage.py +++ b/pygmt/src/grdimage.py @@ -16,7 +16,6 @@ @fmt_docstring @use_alias( - B="frame", C="cmap", D="img_in", E="dpi", @@ -28,12 +27,13 @@ p="perspective", ) @kwargs_to_strings(p="sequence") -def grdimage( +def grdimage( # noqa: PLR0913 self, grid: PathLike | xr.DataArray, monochrome: bool = False, no_clip: bool = False, projection: str | None = None, + frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -76,6 +76,7 @@ def grdimage( Full GMT docs at :gmt-docs:`grdimage.html`. {aliases} + - B = frame - J = projection - M = monochrome - N = no_clip @@ -181,6 +182,7 @@ def grdimage( M=Alias(monochrome, name="monochrome"), N=Alias(no_clip, name="no_clip"), ).add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/grdview.py b/pygmt/src/grdview.py index c7fca45d512..4214a92a19a 100644 --- a/pygmt/src/grdview.py +++ b/pygmt/src/grdview.py @@ -18,7 +18,6 @@ @use_alias( Jz="zscale", JZ="zsize", - B="frame", C="cmap", G="drapegrid", N="plane", @@ -36,6 +35,7 @@ def grdview( self, grid: PathLike | xr.DataArray, projection: str | None = None, + frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -55,6 +55,7 @@ def grdview( Full GMT docs at :gmt-docs:`grdview.html`. {aliases} + - B = frame - J = projection - R = region - V = verbose @@ -157,6 +158,7 @@ def grdview( self._activate_figure() aliasdict = AliasSystem().add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/histogram.py b/pygmt/src/histogram.py index 18cefe52ad4..03e4966e91a 100644 --- a/pygmt/src/histogram.py +++ b/pygmt/src/histogram.py @@ -14,7 +14,6 @@ @fmt_docstring @use_alias( A="horizontal", - B="frame", C="cmap", D="annotate", E="barwidth", @@ -41,6 +40,7 @@ def histogram( self, data: PathLike | TableLike, projection: str | None = None, + frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -54,6 +54,7 @@ def histogram( Full GMT docs at :gmt-docs:`histogram.html`. {aliases} + - B = frame - J = projection - R = region - V = verbose @@ -150,6 +151,7 @@ def histogram( self._activate_figure() aliasdict = AliasSystem().add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index 0ee7e06258b..d7ddf89345b 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -118,7 +118,6 @@ def _auto_offset(spec) -> bool: @fmt_docstring @use_alias( A="offset", - B="frame", C="cmap", E="extensionfill", Fr="labelbox", @@ -143,6 +142,7 @@ def meca( # noqa: PLR0913 event_name: str | Sequence[str] | None = None, no_clip: bool = False, projection: str | None = None, + frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -202,6 +202,7 @@ def meca( # noqa: PLR0913 Full GMT docs at :gmt-docs:`supplements/seis/meca.html`. {aliases} + - B = frame - J = projection - N = no_clip - R = region @@ -374,6 +375,7 @@ def meca( # noqa: PLR0913 aliasdict = AliasSystem( N=Alias(no_clip, name="no_clip"), ).add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/plot.py b/pygmt/src/plot.py index 802c9892f70..858a783333b 100644 --- a/pygmt/src/plot.py +++ b/pygmt/src/plot.py @@ -22,7 +22,6 @@ @fmt_docstring @use_alias( - B="frame", C="cmap", D="offset", E="error_bar", @@ -57,6 +56,7 @@ def plot( # noqa: PLR0912, PLR0913 direction=None, straight_line: bool | Literal["x", "y"] = False, projection: str | None = None, + frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -89,6 +89,7 @@ def plot( # noqa: PLR0912, PLR0913 {aliases} - A = straight_line + - B = frame - J = projection - R = region - V = verbose @@ -294,6 +295,7 @@ def plot( # noqa: PLR0912, PLR0913 aliasdict = AliasSystem( A=Alias(straight_line, name="straight_line"), ).add_common( + B=frame, R=region, J=projection, V=verbose, diff --git a/pygmt/src/plot3d.py b/pygmt/src/plot3d.py index d572104ed70..d7c1f270e1e 100644 --- a/pygmt/src/plot3d.py +++ b/pygmt/src/plot3d.py @@ -22,7 +22,6 @@ @fmt_docstring @use_alias( - B="frame", C="cmap", D="offset", G="fill", @@ -59,6 +58,7 @@ def plot3d( # noqa: PLR0912, PLR0913 direction=None, straight_line: bool | Literal["x", "y"] = False, projection: str | None = None, + frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -91,6 +91,7 @@ def plot3d( # noqa: PLR0912, PLR0913 {aliases} - A = straight_line + - B = frame - J = projection - R = region - V = verbose @@ -273,6 +274,7 @@ def plot3d( # noqa: PLR0912, PLR0913 aliasdict = AliasSystem( A=Alias(straight_line, name="straight_line"), ).add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/rose.py b/pygmt/src/rose.py index 4900465d07d..4f1fca4b343 100644 --- a/pygmt/src/rose.py +++ b/pygmt/src/rose.py @@ -14,7 +14,6 @@ @fmt_docstring @use_alias( A="sector", - B="frame", C="cmap", D="shift", Em="vectors", @@ -43,6 +42,7 @@ def rose( data: PathLike | TableLike | None = None, length=None, azimuth=None, + frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -66,6 +66,7 @@ def rose( Full GMT docs at :gmt-docs:`rose.html`. {aliases} + - B = frame - R = region - V = verbose - c = panel @@ -210,6 +211,7 @@ def rose( self._activate_figure() aliasdict = AliasSystem().add_common( + B=frame, R=region, V=verbose, c=panel, diff --git a/pygmt/src/solar.py b/pygmt/src/solar.py index 237bb6ae226..dc7fd8e3018 100644 --- a/pygmt/src/solar.py +++ b/pygmt/src/solar.py @@ -15,15 +15,16 @@ @fmt_docstring -@use_alias(B="frame", p="perspective") +@use_alias(p="perspective") @kwargs_to_strings(p="sequence") -def solar( +def solar( # noqa: PLR0913 self, terminator: Literal["astronomical", "civil", "day_night", "nautical"] = "day_night", terminator_datetime=None, fill: str | None = None, pen: str | None = None, projection: str | None = None, + frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -40,6 +41,7 @@ def solar( Full GMT docs at :gmt-docs:`solar.html`. {aliases} + - B = frame - G = fill - J = projection - R = region @@ -139,6 +141,7 @@ def solar( ], W=Alias(pen, name="pen"), ).add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/subplot.py b/pygmt/src/subplot.py index db64120d206..8916d0edbb7 100644 --- a/pygmt/src/subplot.py +++ b/pygmt/src/subplot.py @@ -23,7 +23,6 @@ Ff="figsize", Fs="subsize", A="autolabel", - B="frame", C="clearance", SC="sharex", SR="sharey", @@ -36,6 +35,7 @@ def subplot( ncols=1, margins: float | str | Sequence[float | str] | None = None, projection: str | None = None, + frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -53,6 +53,7 @@ def subplot( Full GMT docs at :gmt-docs:`subplot.html#synopsis-begin-mode`. {aliases} + - B = frame - J = projection - M = margins - R = region @@ -175,6 +176,7 @@ def subplot( aliasdict = AliasSystem( M=Alias(margins, name="margins", sep="/", size=(2, 4)), ).add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/ternary.py b/pygmt/src/ternary.py index 0133aa6a510..92a52f197f2 100644 --- a/pygmt/src/ternary.py +++ b/pygmt/src/ternary.py @@ -13,7 +13,6 @@ @fmt_docstring @use_alias( - B="frame", C="cmap", G="fill", JX="width", @@ -28,6 +27,7 @@ def ternary( alabel: str | None = None, blabel: str | None = None, clabel: str | None = None, + frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -49,6 +49,7 @@ def ternary( Full GMT docs at :gmt-docs:`ternary.html`. {aliases} + - B = frame - L = alabel/blabel/clabel - R = region - V = verbose @@ -98,6 +99,7 @@ def ternary( aliasdict = AliasSystem( L=Alias(labels, name="alabel/blabel/clabel", sep="/", size=3), ).add_common( + B=frame, R=region, V=verbose, c=panel, diff --git a/pygmt/src/text.py b/pygmt/src/text.py index bb6efe24925..817e26e8d9b 100644 --- a/pygmt/src/text.py +++ b/pygmt/src/text.py @@ -24,7 +24,6 @@ @fmt_docstring @use_alias( - B="frame", C="clearance", D="offset", G="fill", @@ -50,6 +49,7 @@ def text_( # noqa: PLR0912, PLR0913, PLR0915 justify: bool | None | AnchorCode | Sequence[AnchorCode] = None, no_clip: bool = False, projection: str | None = None, + frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -74,6 +74,7 @@ def text_( # noqa: PLR0912, PLR0913, PLR0915 Full GMT docs at :gmt-docs:`text.html`. {aliases} + - B = frame - F = **+a**: angle, **+c**: position, **+j**: justify, **+f**: font - J = projection - N = no_clip @@ -275,6 +276,7 @@ def text_( # noqa: PLR0912, PLR0913, PLR0915 aliasdict = AliasSystem( N=Alias(no_clip, name="no_clip"), ).add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/tilemap.py b/pygmt/src/tilemap.py index f9684b9af1f..e6a2ed4c2cb 100644 --- a/pygmt/src/tilemap.py +++ b/pygmt/src/tilemap.py @@ -18,13 +18,7 @@ @fmt_docstring -@use_alias( - B="frame", - E="dpi", - I="shading", - Q="nan_transparent", - p="perspective", -) +@use_alias(E="dpi", I="shading", Q="nan_transparent", p="perspective") @kwargs_to_strings(p="sequence") def tilemap( # noqa: PLR0913 self, @@ -38,6 +32,7 @@ def tilemap( # noqa: PLR0913 monochrome: bool = False, no_clip: bool = False, projection: str | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, @@ -58,6 +53,7 @@ def tilemap( # noqa: PLR0913 provide Spherical Mercator (EPSG:3857) coordinates to the ``region`` parameter. {aliases} + - B = frame - J = projection - M = monochrome - N = no_clip @@ -137,6 +133,7 @@ def tilemap( # noqa: PLR0913 M=Alias(monochrome, name="monochrome"), N=Alias(no_clip, name="no_clip"), ).add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/velo.py b/pygmt/src/velo.py index 80ae59e7db4..3771cff41ae 100644 --- a/pygmt/src/velo.py +++ b/pygmt/src/velo.py @@ -17,7 +17,6 @@ @fmt_docstring @use_alias( A="vector", - B="frame", C="cmap", D="rescale", E="uncertaintyfill", @@ -40,6 +39,7 @@ def velo( data: PathLike | TableLike | None = None, no_clip: bool = False, projection: str | None = None, + frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, @@ -62,6 +62,7 @@ def velo( Full GMT docs at :gmt-docs:`supplements/geodesy/velo.html`. {aliases} + - B = frame - J = projection - N = no_clip - R = region @@ -268,6 +269,7 @@ def velo( aliasdict = AliasSystem( N=Alias(no_clip, name="no_clip"), ).add_common( + B=frame, J=projection, R=region, V=verbose, diff --git a/pygmt/src/wiggle.py b/pygmt/src/wiggle.py index 496c4eae88f..f2bb807187b 100644 --- a/pygmt/src/wiggle.py +++ b/pygmt/src/wiggle.py @@ -40,7 +40,6 @@ def _parse_fills(fillpositive, fillnegative): @fmt_docstring @use_alias( - B="frame", D="position", T="track", W="pen", @@ -66,6 +65,7 @@ def wiggle( # noqa: PLR0913 fillnegative=None, projection: str | None = None, region: Sequence[float | str] | str | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, @@ -83,6 +83,7 @@ def wiggle( # noqa: PLR0913 Full GMT docs at :gmt-docs:`wiggle.html`. {aliases} + - B = frame - G = **+p**: fillpositive, **+n**: fillnegative - J = projection - R = region @@ -141,6 +142,7 @@ def wiggle( # noqa: PLR0913 aliasdict = AliasSystem( G=Alias(_fills, name="fillpositive/fillnegative"), ).add_common( + B=frame, J=projection, R=region, V=verbose,