Skip to content

Commit bddba5b

Browse files
committed
Improve directional rose
1 parent a04c737 commit bddba5b

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

pygmt/src/directional_rose.py

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,11 @@ def directional_rose(
1515
self,
1616
position: Sequence[str | float] | AnchorCode,
1717
position_type: Literal[
18-
"mapcoords",
19-
"boxcoords",
20-
"plotcoords",
21-
"inside",
22-
"outside",
18+
"mapcoords", "boxcoords", "plotcoords", "inside", "outside"
2319
] = "plotcoords",
24-
width: float | str | None = None,
2520
anchor: AnchorCode | None = None,
2621
anchor_offset: Sequence[float | str] | None = None,
22+
width: float | str | None = None,
2723
label: Sequence[str] | bool = False,
2824
fancy: Literal[1, 2, 3] | bool = False,
2925
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
@@ -35,7 +31,8 @@ def directional_rose(
3531
3632
The directional rose is plotted at the location defined by the reference point
3733
(specified by the **position** and *position_type** parameters) and anchor point
38-
(set by the **anchor** and **anchor_offset** parameters).
34+
(specified by the **anchor** and **anchor_offset** parameters). Refer to
35+
:doc:`/techref/reference_anchor_points` for details about the positioning.
3936
4037
Parameters
4138
----------
@@ -53,21 +50,22 @@ def directional_rose(
5350
- ``"inside"`` or ``"outside"``: **position** is the justification code, meaning
5451
the anchor point of the rose is inside or outside the plot bounding box.
5552
anchor
56-
The anchor point of the rose, set by a 2-character justification code.
53+
Anchor point of the directional rose, set by a
54+
:doc:`2-character justification code </techref/justification_codes>`.
5755
The default value depends on the **position_type** parameter.
5856
59-
- ``position_type="inside"``, **anchor** defaults to the same as **position**.
60-
- ``position_type="outside"``, **anchor** defaults to the mirror opposite of
57+
- ``position_type="inside"``: **anchor** defaults to the same as **position**.
58+
- ``position_type="outside"``: **anchor** defaults to the mirror opposite of
6159
**position**.
6260
- Otherwise, **anchor** defaults to ``"MC"`` (middle center).
6361
anchor_offset
6462
*offset* or (*offset_x*, *offset_y*).
6563
Offset the anchor point by *offset_x* and *offset_y*. If a single value *offset*
6664
is given, *offset_y* = *offset_x* = *offset*.
6765
width
68-
Width of the rose in plot coordinates (append **i** (inch),
69-
**cm** (centimeters), or **p** (points)), or append % for a size in percentage
70-
of map width [Default is 10 %].
66+
Width of the rose in plot coordinates (append **i** (inch), **cm**
67+
(centimeters), or **p** (points)), or append % for a size in percentage of map
68+
width [Default is 10 %].
7169
label
7270
A sequence of four strings to label the cardinal points W,E,S,N. Use an empty
7371
string to skip a specific label. If set to ``True``, use the default labels
@@ -80,7 +78,7 @@ def directional_rose(
8078
- Level 3 adds the four minor orientations WNW-ESE, NNW-SSE, NNE-SSW, and
8179
ENE-WSW
8280
83-
If set to ``True``, it defaults to level 1.
81+
If set to ``True``, defaults to level 1.
8482
{perspective}
8583
{verbose}
8684
{transparency}
@@ -109,10 +107,10 @@ def directional_rose(
109107
},
110108
),
111109
Alias(position, name="position", sep="/", size=2),
112-
Alias(fancy, name="fancy", prefix="+f"), # +F is not supported yet.
113110
Alias(anchor, name="anchor", prefix="+j"),
114-
Alias(label, name="label", prefix="+l", sep=",", size=4),
115111
Alias(anchor_offset, name="anchor_offset", prefix="+o", sep="/", size=2),
112+
Alias(fancy, name="fancy", prefix="+f"), # +F is not supported yet.
113+
Alias(label, name="label", prefix="+l", sep=",", size=4),
116114
Alias(width, name="width", prefix="+w"),
117115
],
118116
).add_common(

0 commit comments

Comments
 (0)