@@ -40,44 +40,44 @@ class Position(BaseParam):
4040
4141 **Reference Point**
4242
43- The *reference point* can be specified in five different ways using the ``type`` and
44- ``refpoint`` attributes:
43+ The *reference point* can be specified in five different ways using the ``cstype``
44+ and ``refpoint`` attributes:
4545
46- ``type ="mapcoords"`` Map Coordinates
46+ ``cstype ="mapcoords"`` Map Coordinates
4747 Use data/geographic coordinates. Specify ``refpoint`` as
4848 (*longitude*, *latitude*). Useful when tying the embellishment to a specific
4949 geographic location.
5050
51- **Example:** ``refpoint=(135, 20), type ="mapcoords"``
51+ **Example:** ``refpoint=(135, 20), cstype ="mapcoords"``
5252
53- ``type ="plotcoords"`` Plot Coordinates
53+ ``cstype ="plotcoords"`` Plot Coordinates
5454 Use plot coordinates as distances from the lower-left plot origin. Specify
5555 ``refpoint`` as (*x*, *y*) with units (e.g., inches, centimeters, points).
5656 Useful for precise layout control.
5757
58- **Example:** ``refpoint=("2c", "2.5c"), type ="plotcoords"``
58+ **Example:** ``refpoint=("2c", "2.5c"), cstype ="plotcoords"``
5959
60- ``type ="boxcoords"`` Normalized Coordinates
60+ ``cstype ="boxcoords"`` Normalized Coordinates
6161 Use normalized coordinates where (0, 0) is the lower-left corner and (1, 1) is
6262 the upper-right corner of the bounding box of the current plot. Specify
6363 ``refpoint`` as (*nx*, *ny*). Useful for positioning relative to plot dimensions
6464 without units.
6565
66- **Example:** ``refpoint=(0.2, 0.1), type ="boxcoords"``
66+ **Example:** ``refpoint=(0.2, 0.1), cstype ="boxcoords"``
6767
68- ``type ="inside"`` Inside Plot
68+ ``cstype ="inside"`` Inside Plot
6969 Select one of the nine :doc:`justification codes </techref/justification_codes>`
7070 as the *reference point*. The *anchor point* defaults to be the same as the
7171 *reference point*, so the embellishment is placed inside the plot.
7272
73- **Example:** ``refpoint="TL", type ="inside"``
73+ **Example:** ``refpoint="TL", cstype ="inside"``
7474
75- ``type ="outside"`` Outside Plot
76- Similar to ``type ="inside"``, but the *anchor point* defaults to the mirror
75+ ``cstype ="outside"`` Outside Plot
76+ Similar to ``cstype ="inside"``, but the *anchor point* defaults to the mirror
7777 opposite of the *reference point*. Useful for placing embellishments outside
7878 the plot boundaries (e.g., color bars).
7979
80- **Example:** ``refpoint="TL", type ="outside"``
80+ **Example:** ``refpoint="TL", cstype ="outside"``
8181
8282 **Anchor Point**
8383
@@ -88,9 +88,9 @@ class Position(BaseParam):
8888 Set ``anchor`` explicitly to override these defaults. If not set, the default
8989 *anchor* behaviors are:
9090
91- - ``type ="inside"``: Same as the *reference point* justification code
92- - ``type ="outside"``: Mirror opposite of the *reference point* justification code
93- - Other types : ``"MC"`` (middle center) for map rose and scale, ``"BL"``
91+ - ``cstype ="inside"``: Same as the *reference point* justification code
92+ - ``cstype ="outside"``: Mirror opposite of the *reference point* justification code
93+ - Other cstypes : ``"MC"`` (middle center) for map rose and scale, ``"BL"``
9494 (bottom-left) for other embellishments
9595
9696 **Offset**
@@ -110,7 +110,9 @@ class Position(BaseParam):
110110 >>> fig = pygmt.Figure()
111111 >>> fig.basemap(region=[0, 10, 0, 10], projection="X10c", frame=True)
112112 >>> fig.logo(
113- ... position=Position((3, 3), type="mapcoords", anchor="ML", offset=(0.2, 0.2)),
113+ ... position=Position(
114+ ... (3, 3), cstype="mapcoords", anchor="ML", offset=(0.2, 0.2)
115+ ... ),
114116 ... box=True,
115117 ... )
116118 >>> fig.show()
@@ -119,20 +121,20 @@ class Position(BaseParam):
119121
120122 >>> fig = pygmt.Figure()
121123 >>> fig.basemap(region=[0, 10, 0, 10], projection="X10c", frame=True)
122- >>> fig.logo(position=Position("TL", type ="inside", offset="0.2c"), box=True)
124+ >>> fig.logo(position=Position("TL", cstype ="inside", offset="0.2c"), box=True)
123125 >>> fig.show()
124126 """
125127
126- #: Location of the reference point on the plot. The format depends on ``type ``:
128+ #: Location of the reference point on the plot. The format depends on ``cstype ``:
127129 #:
128- #: - ``type ="mapcoords"``: (*longitude*, *latitude*)
129- #: - ``type ="plotcoords"``: (*x*, *y*) with plot units
130- #: - ``type ="boxcoords"``: (*nx*, *ny*)
131- #: - ``type ="inside"`` or ``"outside"``:
130+ #: - ``cstype ="mapcoords"``: (*longitude*, *latitude*)
131+ #: - ``cstype ="plotcoords"``: (*x*, *y*) with plot units
132+ #: - ``cstype ="boxcoords"``: (*nx*, *ny*)
133+ #: - ``cstype ="inside"`` or ``"outside"``:
132134 #: :doc:`2-character justification codes </techref/justification_codes>`
133135 refpoint : Sequence [float | str ] | AnchorCode
134136
135- #: Type of the reference point. Valid values are:
137+ #: cstype of the reference point. Valid values are:
136138 #:
137139 #: - ``"mapcoords"``: Map/Data coordinates
138140 #: - ``"plotcoords"``: Plot coordinates
@@ -141,13 +143,13 @@ class Position(BaseParam):
141143 #:
142144 #: If not specified, defaults to ``"inside"`` if ``refpoint`` is a justification
143145 #: code; otherwise defaults to ``"plotcoords"``.
144- type : (
146+ cstype : (
145147 Literal ["mapcoords" , "inside" , "outside" , "boxcoords" , "plotcoords" ] | None
146148 ) = None
147149
148150 #: Anchor point on the embellishment using a
149151 #: :doc:`2-character justification code </techref/justification_codes>`.
150- #: If ``None``, defaults are applied based on ``type `` (see above).
152+ #: If ``None``, defaults are applied based on ``cstype `` (see above).
151153 anchor : AnchorCode | None = None
152154
153155 #: Offset for the anchor point as a single value or (*offset_x*, *offset_y*).
@@ -162,12 +164,12 @@ def _validate(self):
162164 f"{ v } { h } " for v in "TMB" for h in "LCR"
163165 }
164166
165- # Default to "inside" if type is not specified and location is an anchor code.
166- if self .type is None :
167- self .type = "inside" if isinstance (self .refpoint , str ) else "plotcoords"
167+ # Default to "inside" if cstype is not specified and location is an anchor code.
168+ if self .cstype is None :
169+ self .cstype = "inside" if isinstance (self .refpoint , str ) else "plotcoords"
168170
169- # Validate the location based on type .
170- match self .type :
171+ # Validate the location based on cstype .
172+ match self .cstype :
171173 case "mapcoords" | "plotcoords" | "boxcoords" :
172174 if not is_nonstr_iter (self .refpoint ) or len (self .refpoint ) != 2 :
173175 raise GMTValueError (
@@ -194,8 +196,8 @@ def _validate(self):
194196 def _aliases (self ):
195197 return [
196198 Alias (
197- self .type ,
198- name = "type " ,
199+ self .cstype ,
200+ name = "cstype " ,
199201 mapping = {
200202 "mapcoords" : "g" ,
201203 "boxcoords" : "n" ,
0 commit comments