Skip to content

Commit 88fafa5

Browse files
Improve documentation for +r option in the regions tutorial (#1027)
Co-authored-by: Will Schlitzer <schlitzer90@gmail.com>
1 parent 29d6088 commit 88fafa5

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

examples/tutorials/regions.py

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
fig = pygmt.Figure()
2929
fig.coast(
30-
# Sets the x-range from 10E to 20E and the y-range to 35N to 45N
30+
# Set the x-range from 10E to 20E and the y-range to 35N to 45N
3131
region="10/20/35/45",
3232
# Set projection to Mercator, and the figure size to 15 centimeters
3333
projection="M15c",
@@ -46,12 +46,12 @@
4646

4747
########################################################################################
4848
#
49-
# The coordinates can be passed to ``region`` as a list, in the form
50-
# of [*xmin*,\ *xmax*,\ *ymin*,\ *ymax*].
49+
# The coordinates can be passed to ``region`` as a list, in the form of
50+
# [*xmin*,\ *xmax*,\ *ymin*,\ *ymax*].
5151

5252
fig = pygmt.Figure()
5353
fig.coast(
54-
# Sets the x-range from 10E to 20E and the y-range to 35N to 45N
54+
# Set the x-range from 10E to 20E and the y-range to 35N to 45N
5555
region=[10, 20, 35, 45],
5656
projection="M12c",
5757
land="lightgray",
@@ -71,7 +71,7 @@
7171

7272
fig = pygmt.Figure()
7373
fig.coast(
74-
# Sets the bottom-left corner as 10E, 35N and the top-right corner as 20E, 45N
74+
# Set the bottom-left corner as 10E, 35N and the top-right corner as 20E, 45N
7575
region="10/35/20/45+r",
7676
projection="M12c",
7777
land="lightgray",
@@ -133,7 +133,7 @@
133133

134134
fig = pygmt.Figure()
135135
fig.coast(
136-
# Sets the figure region to encompass Japan with the ISO code "JP"
136+
# Set the figure region to encompass Japan with the ISO code "JP"
137137
region="JP",
138138
projection="M12c",
139139
land="lightgray",
@@ -147,14 +147,13 @@
147147
########################################################################################
148148
#
149149
# The area encompassed by the ISO code can be expanded by appending **+r**\ *increment*
150-
# to the ISO code. The *increment* unit is in degrees, and if only value is added it
151-
# expands the range of the region in all directions. Using **+r** rounds to the nearest
152-
# increment.
150+
# to the ISO code. The *increment* unit is in degrees, and if only one value is added it
151+
# expands the range of the region in all directions. Using **+r** expands the
152+
# final region boundaries to be multiples of *increment* .
153153

154154
fig = pygmt.Figure()
155155
fig.coast(
156-
# Expands the region setting outside the range of Japan by 3 degrees in all
157-
# directions
156+
# Expand the region boundaries to be multiples of 3 degrees in all directions
158157
region="JP+r3",
159158
projection="M12c",
160159
land="lightgray",
@@ -172,7 +171,7 @@
172171

173172
fig = pygmt.Figure()
174173
fig.coast(
175-
# Expands the region setting outside the range of Japan by 3 degrees on the x-axis
174+
# Expand the region boundaries to be multiples of 3 degrees on the x-axis
176175
# and 5 degrees on the y-axis.
177176
region="JP+r3/5",
178177
projection="M12c",
@@ -193,7 +192,7 @@
193192

194193
fig = pygmt.Figure()
195194
fig.coast(
196-
# Expands the region setting outside the range of Japan by 3 degrees to the west,
195+
# Expand the region boundaries to be multiples of 3 degrees to the west,
197196
# 5 degrees to the east, 7 degrees to the south, and 9 degrees to the north.
198197
region="JP+r3/5/7/9",
199198
projection="M12c",
@@ -212,7 +211,7 @@
212211

213212
fig = pygmt.Figure()
214213
fig.coast(
215-
# Expands the region setting outside the range of Japan by 3 degrees in all
214+
# Expand the region setting outside the range of Japan by 3 degrees in all
216215
# directions, without rounding to the nearest increment.
217216
region="JP+R3",
218217
projection="M12c",
@@ -226,13 +225,13 @@
226225

227226
########################################################################################
228227
#
229-
# The ``region`` increment can be appended with **+e**, which expand the bounding box
230-
# by at least 25% beyond the increment.
228+
# The ``region`` increment can be appended with **+e**, which is like **+r** and
229+
# expands the final region boundaries to be multiples of *increment*. However,
230+
# it ensures that the bounding box extends by at least 0.25 times the increment.
231231

232232
fig = pygmt.Figure()
233233
fig.coast(
234-
# Expands the region setting outside the range of Japan by 3 degrees in all
235-
# directions, without rounding to the nearest increment.
234+
# Expand the region boundaries to be multiples of 3 degrees in all directions
236235
region="JP+e3",
237236
projection="M12c",
238237
land="lightgray",

0 commit comments

Comments
 (0)