Skip to content

Commit 6f9153c

Browse files
committed
Updates
1 parent 8c46b9a commit 6f9153c

File tree

1 file changed

+31
-25
lines changed

1 file changed

+31
-25
lines changed

pygmt/src/directional_rose.py

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,45 @@ def directional_rose(
2222
"outside",
2323
] = "plotcoords",
2424
width: float | str | None = None,
25-
justify: AnchorCode | None = None,
25+
anchor: AnchorCode | None = None,
2626
anchor_offset: Sequence[float | str] | None = None,
2727
label: Sequence[str] | bool = False,
2828
fancy: Literal[1, 2, 3] | bool = False,
2929
):
3030
r"""
31-
Add a directional rose to the map.
31+
Add a directional rose on the map.
32+
33+
The directional rose is plotted at the location defined by the reference point
34+
(specified by the **position** and *position_type** parameters) and anchor point
35+
(set by the **anchor** and **anchor_offset** parameters).
3236
3337
Parameters
3438
----------
3539
position/position_type
36-
Location of the directional rose. The actual meaning of this parameter depends
37-
on the ``position_type`` parameter.
40+
Reference point on the map for the directional rose. The meaning of the
41+
**position** parameter depends on the **position_type** parameter:
3842
39-
- ``"mapcoords"``: *position* is given as (x, y) in user coordinates.
40-
- ``"boxcoords"``: *position* is given as (nx, ny) in normalized coordinates,
43+
- ``"mapcoords"``: **position** is given as (x, y) in user coordinates.
44+
- ``"boxcoords"``: **position** is given as (nx, ny) in normalized coordinates,
4145
where (0, 0) is the lower-left corner and (1, 1) is the upper-right corner of
42-
the plot.
43-
- ``"plotcoords"``: *position* is given as (x, y) in plot coordinates, i.e., the
44-
distances in inches, centimeters, or points from the lower left plot origin.
45-
- ``"inside"``: *position* is given as a two-character justification code,
46-
meaning the anchor point of the rose is inside the plot bounding box.
47-
- ``"outside"``: *position* is given as a two-character justification code, but
48-
the rose is outside the plot bounding box.
46+
the plot bounding box.
47+
- ``"plotcoords"``: **position** is given as (x, y) in plot coordinates, i.e.,
48+
the distances in inches, centimeters, or points from the lower left plot
49+
origin.
50+
- ``"inside"`` or ``"outside"``: **position** is the justification code, meaning
51+
the anchor point of the rose is inside or outside the plot bounding box.
52+
anchor
53+
The anchor point of the rose, set by a 2-character justification code.
54+
The default value depends on the **position_type** parameter.
55+
56+
- ``position_type="inside"``, **anchor** defaults to the same as **position**.
57+
- ``position_type="outside"``, **anchor** defaults to the mirror opposite of
58+
**position**.
59+
- Otherwise, **anchor** defaults to ``"MC"`` (middle center).
60+
anchor_offset
61+
*offset* or (*offset_x*, *offset_y*).
62+
Offset the anchor point by *offset_x* and *offset_y*. If a single value *offset*
63+
is given, *offset_y* = *offset_x* = *offset*.
4964
width
5065
Width of the rose in plot coordinates (append **i** (inch),
5166
**cm** (centimeters), or **p** (points)), or append % for a size in percentage
@@ -63,15 +78,6 @@ def directional_rose(
6378
ENE-WSW
6479
6580
If set to ``True``, it defaults to level 1.
66-
anchor_offset
67-
*offset* or (*offset_x*, *offset_y*).
68-
Offset the anchor point by *offset_x* and *offset_y*. If a single value *offset*
69-
is given, *offset_y* = *offset_x* = *offset*.
70-
justify
71-
Set the anchor point. Specify a two-character (order independent) code. Choose
72-
from vertical **T**\(op), **M**\(iddle), or **B**\(ottom) and horizontal
73-
**L**\(eft), **C**\(entre), or **R**\(ight).
74-
7581
{perspective}
7682
{verbose}
7783
{transparency}
@@ -100,11 +106,11 @@ def directional_rose(
100106
},
101107
),
102108
Alias(position, name="position", sep="/", size=2),
103-
Alias(width, name="width", prefix="+w"),
104-
Alias(fancy, name="fancy", prefix="+f"),
105-
Alias(justify, name="justify", prefix="+j"),
109+
Alias(fancy, name="fancy", prefix="+f"), # +F is not supported yet.
110+
Alias(anchor, name="anchor", prefix="+j"),
106111
Alias(label, name="label", prefix="+l", sep=",", size=4),
107112
Alias(anchor_offset, name="anchor_offset", prefix="+o", sep="/", size=2),
113+
Alias(width, name="width", prefix="+w"),
108114
],
109115
)
110116

0 commit comments

Comments
 (0)