-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Since noone worked on this issue during the scipy-sprint here's a gallery example adressing #1384.
- Loading branch information
1 parent
945bbc5
commit dc5cf3e
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import pygmt | ||
|
||
fig = pygmt.Figure() | ||
|
||
# Load sample grid and use area around the Hawaiian Islands | ||
grid = pygmt.datasets.load_earth_relief(resolution="01m", region = [-162, -153, 18, 23]) | ||
|
||
# Plot original grid | ||
fig.basemap(region = [-162, -153, 18, 23], projection="M12c", frame=["f", '+t"original grid"']) | ||
fig.grdimage(grid=grid, cmap="oleron") | ||
|
||
fig.shift_origin(yshift = "-9c") | ||
|
||
# Set all grid points < 0 to a value of -2000. | ||
grid = pygmt.grdclip(grid, below = [0, -2000]) | ||
|
||
# Plot clipped grid | ||
fig.basemap(region = [-162, -153, 18, 23], projection="M12c", frame=["f", '+t"clipped grid"']) | ||
fig.grdimage(grid=grid) | ||
fig.colorbar(frame=["x+lElevation", "y+lm"]) | ||
|
||
fig.show() |