Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation for +r option in the regions tutorial #1027

Merged
merged 5 commits into from
Mar 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 17 additions & 18 deletions examples/tutorials/regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

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

########################################################################################
#
# The coordinates can be passed to ``region`` as a list, in the form
# of [*xmin*,\ *xmax*,\ *ymin*,\ *ymax*].
# The coordinates can be passed to ``region`` as a list, in the form of
# [*xmin*,\ *xmax*,\ *ymin*,\ *ymax*].

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

fig = pygmt.Figure()
fig.coast(
# Sets the bottom-left corner as 10E, 35N and the top-right corner as 20E, 45N
# Set the bottom-left corner as 10E, 35N and the top-right corner as 20E, 45N
region="10/35/20/45+r",
projection="M12c",
land="lightgray",
Expand Down Expand Up @@ -133,7 +133,7 @@

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

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

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

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

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

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

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