2
2
image - Plot an image.
3
3
"""
4
4
5
+ from pygmt .alias import Alias , AliasSystem
5
6
from pygmt .clib import Session
6
- from pygmt .helpers import build_arg_list , fmt_docstring , kwargs_to_strings , use_alias
7
+ from pygmt .helpers import build_arg_list , fmt_docstring
7
8
8
9
9
10
@fmt_docstring
10
- @use_alias (
11
- D = "position" ,
12
- F = "box" ,
13
- G = "bitcolor" ,
14
- J = "projection" ,
15
- M = "monochrome" ,
16
- R = "region" ,
17
- V = "verbose" ,
18
- c = "panel" ,
19
- p = "perspective" ,
20
- t = "transparency" ,
21
- )
22
- @kwargs_to_strings (R = "sequence" , c = "sequence_comma" , p = "sequence" )
23
11
def image (self , imagefile , ** kwargs ):
24
12
r"""
25
13
Place images or EPS files on maps.
@@ -29,8 +17,6 @@ def image(self, imagefile, **kwargs):
29
17
30
18
Full option list at :gmt-docs:`image.html`
31
19
32
- {aliases}
33
-
34
20
Parameters
35
21
----------
36
22
imagefile : str
@@ -67,6 +53,21 @@ def image(self, imagefile, **kwargs):
67
53
{perspective}
68
54
{transparency}
69
55
"""
56
+ alias = AliasSystem (
57
+ R = Alias ("region" , separator = "/" ),
58
+ J = "projection" ,
59
+ D = "position" ,
60
+ F = "box" ,
61
+ G = "bitcolor" ,
62
+ M = "monochrome" ,
63
+ V = "verbose" ,
64
+ c = Alias ("panel" , separator = "," ),
65
+ p = Alias ("perspective" , separator = "/" ),
66
+ t = "transparency" ,
67
+ )
68
+
70
69
kwargs = self ._preprocess (** kwargs )
71
70
with Session () as lib :
72
- lib .call_module (module = "image" , args = build_arg_list (kwargs , infile = imagefile ))
71
+ lib .call_module (
72
+ module = "image" , args = build_arg_list (alias .kwdict , infile = imagefile )
73
+ )
0 commit comments