Skip to content

Commit 607f4db

Browse files
committed
Better arguments for position_type
1 parent 2fdca74 commit 607f4db

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

pygmt/src/directional_rose.py

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
def directional_rose(
1515
self,
1616
position,
17-
position_type: Literal["user", "justify", "mirror", "normalize", "plot"] = "user",
17+
position_type: Literal[
18+
"mapcoords", "inside", "outside", "boxcoords", "plotcoords"
19+
] = "mapcoords",
1820
width: float | str | None = None,
1921
justify: AnchorCode | None = None,
20-
offset: Sequence[float | str] | None = None,
22+
anchor_offset: Sequence[float | str] | None = None,
2123
label: Sequence[str] | bool = False,
2224
fancy: Literal[1, 2, 3] | bool = False,
2325
):
@@ -30,15 +32,17 @@ def directional_rose(
3032
Location of the rose. The actual meaning of this parameter depends on the
3133
``position_type`` parameter.
3234
33-
- ``position_type="user"``: *position* is given as (x, y) in user coordinates.
34-
- ``position_type="normalize"``: *position* is given as (nx, ny) in normalized
35+
- ``position_type="mapcoords"``: *position* is given as (x, y) in user
36+
coordinates.
37+
- ``position_type="boxcoords"``: *position* is given as (nx, ny) in normalized
3538
coordinates, where (0, 0) is the lower-left corner and (1, 1) is the
3639
upper-right corner of the map.
37-
- ``position_type="plot"``: *position* is given as (x, y) in plot coordinates.
38-
- ``position_type="justify"``: *position* is given as a two-character
40+
- ``position_type="plotcoords"``: *position* is given as (x, y) in plot
41+
coordinates.
42+
- ``position_type="inside"``: *position* is given as a two-character
3943
justification code, meaning the anchor point of the rose is inside the map
4044
bounding box.
41-
- ``position_type="mirror"``: *position* is given as a two-character
45+
- ``position_type="outside"``: *position* is given as a two-character
4246
justification code, but the rose is outside the map bounding box.
4347
width
4448
Width of the rose in plot coordinates (append **i** (inch),
@@ -57,7 +61,7 @@ def directional_rose(
5761
ENE-WSW
5862
5963
If set to ``True``, it defaults to level 1.
60-
offset
64+
anchor_offset
6165
*offset* or (*offset_x*, *offset_y*).
6266
Offset the anchor point by *offset_x* and *offset_y*. If a single value *offset*
6367
is given, *offset_y* = *offset_x* = *offset*.
@@ -82,19 +86,19 @@ def directional_rose(
8286
position_type,
8387
name="position_type",
8488
mapping={
85-
"user": "g",
86-
"justify": "j",
87-
"mirror": "J",
88-
"normalize": "n",
89-
"plot": "x",
89+
"mapcoords": "g",
90+
"inside": "j",
91+
"outside": "J",
92+
"boxcoords": "n",
93+
"plotcoords": "x",
9094
},
9195
),
92-
Alias(position, name="position", separator="/"),
96+
Alias(position, name="position", sep="/"),
9397
Alias(width, name="width", prefix="+w"),
9498
Alias(fancy, name="fancy", prefix="+f"),
9599
Alias(justify, name="justify", prefix="+j"),
96-
Alias(label, name="label", prefix="+l", separator=",", size=4),
97-
Alias(offset, name="offset", prefix="+o", separator="/", size=[1, 2]),
100+
Alias(label, name="label", prefix="+l", sep=",", size=4),
101+
Alias(anchor_offset, name="anchor_offset", prefix="+o", sep="/", size=2),
98102
]
99103
)
100104

0 commit comments

Comments
 (0)