Skip to content

Commit 7376e6e

Browse files
Examples: Make position codes consistent in comments (#3312)
1 parent d8133b0 commit 7376e6e

File tree

13 files changed

+37
-38
lines changed

13 files changed

+37
-38
lines changed

examples/gallery/3d_plots/grdview_surface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def ackley(x, y):
6060
# Add colorbar for gridded data
6161
fig.colorbar(
6262
frame="a2f1", # Set annotations in steps of two, tick marks in steps of one
63-
position="JRM", # Place colorbar at position Right Middle
63+
position="JMR", # Place colorbar in the Middle Right (MR) corner
6464
)
6565

6666
fig.show()

examples/gallery/basemaps/double_y_axes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ class can control which axes should be plotted and optionally show annotations,
6363
# Plot points for y2 data
6464
fig.plot(x=x, y=y2, style="s0.28c", fill="red", label="y2")
6565

66-
# Create a legend in the top-left corner of the plot
66+
# Create a legend in the Top Left (TL) corner of the plot with an
67+
# offset of 0.1 centimeters
6768
fig.legend(position="jTL+o0.1c", box=True)
6869

6970
fig.show()

examples/gallery/embellishments/colorbar.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@
1616
horizontal (**L**\ eft, **C**\ enter, **R**\ ight) alignment codes, e.g.
1717
``position="jTR"`` for Top Right.
1818
- **g**: using map coordinates, e.g. ``position="g170/-45"`` for longitude
19-
170E, latitude 45S.
19+
170° East, latitude 45° South.
2020
- **x**: using paper coordinates, e.g. ``position="x5c/7c"`` for 5 cm, 7 cm
2121
from anchor point.
2222
- **n**: using normalized (0-1) coordinates, e.g. ``position="n0.4/0.8"``.
2323
2424
Note that the anchor point defaults to the bottom left (**BL**). Append ``+h``
25-
to ``position`` to get a horizontal colorbar instead of a vertical one
26-
(``+v``).
25+
to ``position`` to get a horizontal colorbar instead of a vertical one (``+v``).
2726
"""
2827

2928
# %%
@@ -34,7 +33,7 @@
3433

3534
# ============
3635
# Create a colorbar designed for seismic tomography - roma
37-
# Colorbar is placed at bottom center (BC) by default if no position is given
36+
# Colorbar is placed at Bottom Center (BC) by default if no position is given
3837
# Add quantity and unit as labels ("+l") to the x and y axes
3938
# Add annotations ("+a") in steps of 0.5 and ticks ("+f") in steps of 0.1
4039
fig.colorbar(cmap="roma", frame=["xa0.5f0.1+lVelocity", "y+lm/s"])
@@ -78,8 +77,8 @@
7877
# Plot the colorbar
7978
fig.colorbar(
8079
cmap=True, # Use colormap set up above
81-
# Colorbar placed inside the plot bounding box (j) at Bottom Left (BL),
82-
# offset (+o) by 0.5 cm horizontally and 0.8 cm vertically from anchor
80+
# Colorbar placed inside the plot bounding box (j) in the Bottom Left (BL) corner,
81+
# with an offset (+o) by 0.5 cm horizontally and 0.8 cm vertically from the anchor
8382
# point, and plotted horizontally (+h)
8483
position="jBL+o0.5c/0.8c+h",
8584
box=True,

examples/gallery/embellishments/inset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
# to "brown", the water to "lightblue", the shorelines width to "thin", and
1717
# adding a frame
1818
fig.coast(region="MG+r2", land="brown", water="lightblue", shorelines="thin", frame="a")
19-
# Create an inset, setting the position to top left, the width to 3.5 cm, and
20-
# the x- and y-offsets to 0.2 cm. The margin is set to 0, and the border is
21-
# "gold" with a pen size of 1.5 points.
19+
# Create an inset, placing it in the Top Left (TL) corner with a width of 3.5 cm and
20+
# x- and y-offsets of 0.2 cm. The margin is set to 0, and the border is "gold" with a
21+
# pen size of 1.5 points.
2222
with fig.inset(position="jTL+w3.5c+o0.2c", margin=0, box="+p1.5p,gold"):
2323
# Create a figure in the inset using coast. This example uses the azimuthal
2424
# orthogonal projection centered at 47E, 20S. The land color is set to

examples/gallery/embellishments/inset_rectangle_region.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
# figure
2626
fig.coast(land="lightbrown", water="azure1", shorelines="2p", area_thresh=1000)
2727

28-
# Create an inset map, setting the position to bottom right, and the x- and
29-
# y-offsets to 0.1 cm, respectively.
28+
# Create an inset map, placing it in the Bottom Right (BR) corner with x- and
29+
# y-offsets of 0.1 cm, respectively.
3030
# The inset map contains the Japan main land. "U54S/3c" means UTM projection
3131
# with a map width of 3 cm. The inset width and height are automatically
3232
# calculated from the specified ``region`` and ``projection`` parameters.

examples/gallery/embellishments/legend.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
fig.plot(x=x, y=y2, style="c0.07c", fill="dodgerblue", label="cos(x)+1.1")
4444

4545
# Add a legend to the plot; place it within the plot bounding box with both
46-
# reference ("J") and anchor ("+j") points being TopRight and with an offset
47-
# of 0.2 centimeters in x and y directions; surround the legend with a box
46+
# reference ("J") and anchor ("+j") points being the Top Right (TR) corner and an
47+
# offset of 0.2 centimeters in x and y directions; surround the legend with a box
4848
fig.legend(position="JTR+jTR+o0.2c", box=True)
4949

5050
# -----------------------------------------------------------------------------
@@ -55,8 +55,8 @@
5555

5656
fig.plot(x=x, y=y4, style="s0.07c", fill="orange", label="cos(x/2)-1.1")
5757

58-
# For a multi-column legend, users have to provide the width via "+w", here it
59-
# is set to 6 centimeters; reference and anchor points are set to BottomRight
58+
# For a multi-column legend, users have to provide the width via "+w", here it is
59+
# set to 6 centimeters; reference and anchor points are the Bottom Right (BR) corner
6060
fig.legend(position="JBR+jBR+o0.2c+w6c", box=True)
6161

6262
fig.show()

examples/gallery/embellishments/logo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
fig = pygmt.Figure()
1212
fig.basemap(region=[0, 10, 0, 2], projection="X6c", frame=True)
1313

14-
# add the GMT logo in the Top Right corner of the current map,
14+
# Add the GMT logo in the Top Right (TR) corner of the current map,
1515
# scaled up to be 3 cm wide and offset by 0.3 cm in x direction
1616
# and 0.6 cm in y direction.
1717
fig.logo(position="jTR+o0.3c/0.6c+w3c")

examples/gallery/embellishments/timestamp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
=========
44
55
The :meth:`pygmt.Figure.timestamp` method can draw the GMT timestamp logo on the plot.
6-
The timestamp will always be shown relative to the bottom-left corner of the plot. By
7-
default, the ``offset`` and ``justify`` parameters are set to ``("-54p", "-54p")``
8-
(x, y directions) and ``"BL"`` (bottom-left), respectively.
6+
The timestamp will always be shown relative to the Bottom Left (BL) corner of the plot.
7+
By default, the ``offset`` and ``justify`` parameters are set to ``("-54p", "-54p")``
8+
(x, y directions) and ``"BL"`` (Bottom Left), respectively.
99
"""
1010

1111
# %%

examples/gallery/images/cross_section.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646

4747
# Add a colorbar for the elevation
4848
fig.colorbar(
49-
# Place the colorbar inside the plot (lower-case "j") with justification
50-
# Bottom Right and an offset ("+o") of 0.7 centimeters and
49+
# Place the colorbar inside the plot (lower-case "j") in the Bottom
50+
# Right (BR) corner with an offset ("+o") of 0.7 centimeters and
5151
# 0.3 centimeters in x or y directions, respectively
5252
# Move the x label above the horizontal colorbar ("+ml")
5353
position="jBR+o0.7c/0.8c+h+w5c/0.3c+ml",

examples/gallery/images/grdlandmask.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
Create 'wet-dry' mask grid
33
==========================
44
5-
The :func:`pygmt.grdlandmask` function allows setting
6-
all nodes on land or water to a specified value using
7-
the ``maskvalues`` parameter.
5+
The :func:`pygmt.grdlandmask` function allows setting all nodes on land
6+
or water to a specified value using the ``maskvalues`` parameter.
87
"""
98

109
# %%

0 commit comments

Comments
 (0)