Skip to content

Commit a5ffde2

Browse files
Update tutorials
1 parent 82bb344 commit a5ffde2

8 files changed

Lines changed: 21 additions & 19 deletions

File tree

examples/tutorials/advanced/3d_perspective_image.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
# Set the surftype to "surface"
5151
surftype="s",
5252
# Set the CPT to "geo"
53-
cmap="geo",
53+
cmap="gmt/geo",
5454
)
5555
fig.show()
5656

@@ -66,7 +66,7 @@
6666
projection="M15c",
6767
zsize="1.5c",
6868
surftype="s",
69-
cmap="geo",
69+
cmap="gmt/geo",
7070
plane=1000, # Set the plane elevation to 1,000 meters
7171
facade_fill="gray", # Color the facade in "gray"
7272
)
@@ -77,7 +77,7 @@
7777
# in the figure. The ``contour_pen`` parameter sets the pen used to draw contour
7878
# lines on the surface. :meth:`pygmt.Figure.colorbar` can be used to add a
7979
# color bar to the figure. The ``cmap`` parameter does not need to be passed
80-
# again. To keep the color bar's alignment similar to the figure, use ``True``
80+
# again. To keep the colorbar's alignment similar to the figure, use ``True``
8181
# as argument for the ``perspective`` parameter.
8282

8383
fig = pygmt.Figure()
@@ -89,7 +89,7 @@
8989
projection="M15c",
9090
zsize="1.5c",
9191
surftype="s",
92-
cmap="geo",
92+
cmap="gmt/geo",
9393
plane=1000,
9494
facade_fill="gray",
9595
# Set the contour pen thickness to 0.1 points

examples/tutorials/advanced/contour_map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
# :meth:`pygmt.Figure.colorbar` method.
8585

8686
fig = pygmt.Figure()
87-
fig.grdimage(grid=grid, cmap="haxby", projection="M10c", frame=True)
87+
fig.grdimage(grid=grid, cmap="gmt/haxby", projection="M10c", frame=True)
8888
fig.grdcontour(grid=grid, annotation=1000, levels=250, limit=[-4000, -2000])
8989
fig.colorbar(frame=["x+lelevation", "y+lm"])
9090
fig.show()

examples/tutorials/advanced/draping_on_3d_surface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
# Set up colormap for the crustal age
5252
pygmt.config(COLOR_NAN="lightgray")
53-
pygmt.makecpt(cmap="batlow", series=[0, 200, 1], reverse=True, overrule_bg=True)
53+
pygmt.makecpt(cmap="SCM/batlow", series=[0, 200, 1], reverse=True, overrule_bg=True)
5454

5555
fig.grdview(
5656
projection="M12c", # Mercator projection with a width of 12 centimeters

examples/tutorials/advanced/earth_relief.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141

4242

4343
# %%
44-
# Set a color map
45-
# ---------------
44+
# Set a colormap
45+
# --------------
4646
#
4747
# :meth:`pygmt.Figure.grdimage` takes the ``cmap`` parameter to set the CPT of the
4848
# figure. Examples of common CPTs for Earth relief are shown below. A full list of CPTs
@@ -52,14 +52,14 @@
5252
# Using the *geo* CPT:
5353

5454
fig = pygmt.Figure()
55-
fig.grdimage(grid=grid, projection="R12c", cmap="geo")
55+
fig.grdimage(grid=grid, projection="R12c", cmap="gmt/geo")
5656
fig.show()
5757

5858
# %%
5959
# Using the *relief* CPT:
6060

6161
fig = pygmt.Figure()
62-
fig.grdimage(grid=grid, projection="R12c", cmap="relief")
62+
fig.grdimage(grid=grid, projection="R12c", cmap="gmt/relief")
6363
fig.show()
6464

6565

@@ -76,7 +76,7 @@
7676
# ``"y+lm"`` sets the y-axis label.
7777

7878
fig = pygmt.Figure()
79-
fig.grdimage(grid=grid, projection="R12c", cmap="geo")
79+
fig.grdimage(grid=grid, projection="R12c", cmap="gmt/geo")
8080
fig.colorbar(frame=["a2500", "x+lElevation", "y+lm"])
8181
fig.show()
8282

@@ -96,7 +96,7 @@
9696

9797
grid = pygmt.datasets.load_earth_relief(resolution="10m", region=[-14, 30, 35, 60])
9898
fig = pygmt.Figure()
99-
fig.grdimage(grid=grid, projection="M15c", frame="a", cmap="geo")
99+
fig.grdimage(grid=grid, projection="M15c", frame="a", cmap="gmt/geo")
100100
fig.colorbar(frame=["a1000", "x+lElevation", "y+lm"])
101101
fig.show()
102102

examples/tutorials/advanced/focal_mechanisms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@
308308
fig.coast(region="d", projection="N10c", land="lightgray", frame=True)
309309

310310
# Set up colormap and colorbar for hypocentral depth
311-
pygmt.makecpt(cmap="lajolla", series=[0, 20])
311+
pygmt.makecpt(cmap="SCM/lajolla", series=[0, 20])
312312
fig.colorbar(frame=["x+lhypocentral depth", "y+lkm"])
313313

314314
fig.meca(

examples/tutorials/advanced/grid_equalization.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# Define figure configuration
3636
pygmt.config(FORMAT_GEO_MAP="ddd.x", MAP_FRAME_TYPE="plain")
3737
# Define the colormap for the figure
38-
pygmt.makecpt(series=[500, 3540], cmap="turku")
38+
pygmt.makecpt(series=[500, 3540], cmap="SCM/turku")
3939
# Setup subplots with two panels
4040
with fig.subplot(
4141
nrows=1, ncols=2, figsize=("13.5c", "4c"), title="Digital Elevation Model"
@@ -104,7 +104,7 @@
104104
# Define figure configuration
105105
pygmt.config(FORMAT_GEO_MAP="ddd.x", MAP_FRAME_TYPE="plain")
106106
# Define the colormap for the figure
107-
pygmt.makecpt(series=[0, divisions, 1], cmap="lajolla")
107+
pygmt.makecpt(series=[0, divisions, 1], cmap="SCM/lajolla")
108108
# Setup subplots with two panels
109109
with fig.subplot(
110110
nrows=1, ncols=2, figsize=("13.5c", "4c"), title="Linear distribution"
@@ -154,7 +154,7 @@
154154
# Define figure configuration
155155
pygmt.config(FORMAT_GEO_MAP="ddd.x", MAP_FRAME_TYPE="plain")
156156
# Define the colormap for the figure
157-
pygmt.makecpt(series=[-4.5, 4.5], cmap="vik")
157+
pygmt.makecpt(series=[-4.5, 4.5], cmap="SCM/vik")
158158
# Setup subplots with two panels
159159
with fig.subplot(
160160
nrows=1, ncols=2, figsize=("13.5c", "4c"), title="Normal distribution"
@@ -218,7 +218,7 @@
218218
# Define figure configuration
219219
pygmt.config(FORMAT_GEO_MAP="ddd.x", MAP_FRAME_TYPE="plain")
220220
# Define the colormap for the figure
221-
pygmt.makecpt(series=[0, divisions, 1], cmap="lajolla")
221+
pygmt.makecpt(series=[0, divisions, 1], cmap="SCM/lajolla")
222222
# Setup subplots with two panels
223223
with fig.subplot(
224224
nrows=1, ncols=2, figsize=("13.5c", "4c"), title="Quadratic distribution"

examples/tutorials/advanced/working_with_panel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def view(central_lon):
123123
fig = pygmt.Figure()
124124
# Set up a colormap for the elevation in meters
125125
pygmt.makecpt(
126-
cmap="oleron",
126+
cmap="SCM/oleron",
127127
# minimum, maximum, step
128128
series=[int(grd_relief.data.min()) - 1, int(grd_relief.data.max()) + 1, 100],
129129
)

examples/tutorials/basics/plot.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@
9090
fig = pygmt.Figure()
9191
fig.basemap(region=region, projection="M15c", frame=True)
9292
fig.coast(land="black", water="skyblue")
93-
pygmt.makecpt(cmap="viridis", series=[data.depth_km.min(), data.depth_km.max()])
93+
pygmt.makecpt(
94+
cmap="matplotlib/viridis", series=[data.depth_km.min(), data.depth_km.max()]
95+
)
9496
fig.plot(
9597
x=data.longitude,
9698
y=data.latitude,

0 commit comments

Comments
 (0)