Skip to content

Commit 7605a21

Browse files
authored
Merge branch 'main' into docstring/perspective
2 parents 409df39 + 0c8f194 commit 7605a21

3 files changed

Lines changed: 27 additions & 13 deletions

File tree

pygmt/src/basemap.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
from collections.abc import Sequence
66
from typing import Literal
77

8-
from pygmt.alias import AliasSystem
8+
from pygmt.alias import Alias, AliasSystem
99
from pygmt.clib import Session
1010
from pygmt.helpers import build_arg_list, fmt_docstring, use_alias
1111

1212

1313
@fmt_docstring
1414
@use_alias(
15-
Jz="zscale",
16-
JZ="zsize",
1715
L="map_scale",
1816
F="box",
1917
Td="rose",
@@ -23,6 +21,8 @@
2321
def basemap(
2422
self,
2523
projection: str | None = None,
24+
zsize: float | str | None = None,
25+
zscale: float | str | None = None,
2626
frame: str | Sequence[str] | bool = False,
2727
region: Sequence[float | str] | str | None = None,
2828
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
@@ -48,6 +48,8 @@ def basemap(
4848
{aliases}
4949
- B = frame
5050
- J = projection
51+
- Jz = zscale
52+
- JZ = zsize
5153
- R = region
5254
- V = verbose
5355
- c = panel
@@ -57,7 +59,7 @@ def basemap(
5759
Parameters
5860
----------
5961
{projection}
60-
zscale/zsize : float or str
62+
zscale/zsize
6163
Set z-axis scaling or z-axis size.
6264
{region}
6365
*Required if this is the first plot command.*
@@ -98,7 +100,10 @@ def basemap(
98100
"""
99101
self._activate_figure()
100102

101-
aliasdict = AliasSystem().add_common(
103+
aliasdict = AliasSystem(
104+
Jz=Alias(zscale, name="zscale"),
105+
JZ=Alias(zsize, name="zsize"),
106+
).add_common(
102107
B=frame,
103108
J=projection,
104109
R=region,

pygmt/src/grdview.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import xarray as xr
99
from pygmt._typing import PathLike
10-
from pygmt.alias import AliasSystem
10+
from pygmt.alias import Alias, AliasSystem
1111
from pygmt.clib import Session
1212
from pygmt.helpers import build_arg_list, fmt_docstring, use_alias
1313

@@ -16,8 +16,6 @@
1616

1717
@fmt_docstring
1818
@use_alias(
19-
Jz="zscale",
20-
JZ="zsize",
2119
C="cmap",
2220
G="drapegrid",
2321
N="plane",
@@ -33,6 +31,8 @@ def grdview(
3331
self,
3432
grid: PathLike | xr.DataArray,
3533
projection: str | None = None,
34+
zscale: float | str | None = None,
35+
zsize: float | str | None = None,
3636
frame: str | Sequence[str] | bool = False,
3737
region: Sequence[float | str] | str | None = None,
3838
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
@@ -56,6 +56,8 @@ def grdview(
5656
{aliases}
5757
- B = frame
5858
- J = projection
59+
- Jz = zscale
60+
- JZ = zsize
5961
- R = region
6062
- V = verbose
6163
- c = panel
@@ -71,7 +73,7 @@ def grdview(
7173
with ``perspective``, optionally append */zmin/zmax* to indicate the range to
7274
use for the 3-D axes [Default is the region given by the input grid].
7375
{projection}
74-
zscale/zsize : float or str
76+
zscale/zsize
7577
Set z-axis scaling or z-axis size.
7678
{frame}
7779
cmap : str
@@ -157,7 +159,10 @@ def grdview(
157159
"""
158160
self._activate_figure()
159161

160-
aliasdict = AliasSystem().add_common(
162+
aliasdict = AliasSystem(
163+
Jz=Alias(zscale, name="zscale"),
164+
JZ=Alias(zsize, name="zsize"),
165+
).add_common(
161166
B=frame,
162167
J=projection,
163168
R=region,

pygmt/src/plot3d.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
D="offset",
2727
G="fill",
2828
I="intensity",
29-
Jz="zscale",
30-
JZ="zsize",
3129
L="close",
3230
N="no_clip",
3331
Q="no_sort",
@@ -57,6 +55,8 @@ def plot3d( # noqa: PLR0912, PLR0913
5755
direction=None,
5856
straight_line: bool | Literal["x", "y"] = False,
5957
projection: str | None = None,
58+
zscale: float | str | None = None,
59+
zsize: float | str | None = None,
6060
frame: str | Sequence[str] | bool = False,
6161
region: Sequence[float | str] | str | None = None,
6262
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
@@ -93,6 +93,8 @@ def plot3d( # noqa: PLR0912, PLR0913
9393
- A = straight_line
9494
- B = frame
9595
- J = projection
96+
- Jz = zscale
97+
- JZ = zsize
9698
- R = region
9799
- V = verbose
98100
- c = panel
@@ -119,7 +121,7 @@ def plot3d( # noqa: PLR0912, PLR0913
119121
can be angle and length, azimuth and length, or x and y components,
120122
depending on the style options chosen.
121123
{projection}
122-
zscale/zsize : float or str
124+
zscale/zsize
123125
Set z-axis scaling or z-axis size.
124126
{region}
125127
straight_line
@@ -274,6 +276,8 @@ def plot3d( # noqa: PLR0912, PLR0913
274276

275277
aliasdict = AliasSystem(
276278
A=Alias(straight_line, name="straight_line"),
279+
Jz=Alias(zscale, name="zscale"),
280+
JZ=Alias(zsize, name="zsize"),
277281
).add_common(
278282
B=frame,
279283
J=projection,

0 commit comments

Comments
 (0)