Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions doc/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ def test_my_plotting_case():
Test that my plotting method works.
"""
fig_ref, fig_test = Figure(), Figure()
fig_ref.grdimage("@earth_relief_01d_g", projection="W120/15c", cmap="geo")
fig_test.grdimage(grid, projection="W120/15c", cmap="geo")
fig_ref.grdimage("@earth_relief_01d_g", projection="W120/15c", cmap="gmt/geo")
fig_test.grdimage(grid, projection="W120/15c", cmap="gmt/geo")
return fig_ref, fig_test
```
2 changes: 1 addition & 1 deletion doc/techref/justification_codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Script showing justification codes for plot embellishments, e.g., a colorbar.
fig = pygmt.Figure()
fig.basemap(projection="X10c/2c", region=[-size, size, -size, size], frame=0)

fig.colorbar(cmap="buda", frame=0, position="jMC+w10c/2c+h")
fig.colorbar(cmap="SCM/buda", frame=0, position="jMC+w10c/2c+h")

for code in codes:
fig.text(
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/3d_plots/grdview_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def ackley(x, y):
projection=f"x{SCALE}c",
zscale=f"{SCALE}c",
surftype="s",
cmap="roma",
cmap="SCM/roma",
perspective=[135, 30], # Azimuth southeast (135°), at elevation 30°
shading="+a45",
)
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/3d_plots/scatter3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
# palette "cubhelix" in categorical format and add the species names as
# annotations for the colorbar
pygmt.makecpt(
cmap="cubhelix",
cmap="cpt-city/cubhelix",
# Use the minimum and maximum of the categorical number code
# to set the lowest_value and the highest_value of the CPT
series=(df.species.cat.codes.min(), df.species.cat.codes.max(), 1),
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/basemaps/ternary.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Define a colormap to be used for the values given in the fourth column
# of the input dataset
pygmt.makecpt(cmap="batlow", series=[0, 80, 10])
pygmt.makecpt(cmap="SCM/batlow", series=[0, 80, 10])

fig.ternary(
data,
Expand Down
8 changes: 4 additions & 4 deletions examples/gallery/embellishments/colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
# Colorbar is placed at Bottom Center (BC) by default if no position is given
# Add quantity and unit as labels ("+l") to the x and y axes
# Add annotations ("+a") in steps of 0.5 and ticks ("+f") in steps of 0.1
fig.colorbar(cmap="roma", frame=["xa0.5f0.1+lVelocity", "y+lm/s"])
fig.colorbar(cmap="SCM/roma", frame=["xa0.5f0.1+lVelocity", "y+lm/s"])

# ============
# Create a colorbar showing the scientific rainbow - batlow
fig.colorbar(
cmap="batlow",
cmap="SCM/batlow",
# Colorbar positioned at map coordinates (g) longitude/latitude 0.3/8.7,
# with a length/width (+w) of 4 cm by 0.5 cm, and plotted horizontally (+h)
position="g0.3/8.7+w4c/0.5c+h",
Expand All @@ -52,7 +52,7 @@
# ============
# Create a colorbar suitable for surface topography - oleron
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we want to update the comments? For new users the leading folder could be unclear. Edit maybe we don not need the "by Fabio Crameri" each time?

Suggested change
# Create a colorbar suitable for surface topography - oleron
# Create a colorbar suitable for surface topography - oleron from the Scientific colour maps (SCM) by Fabio Crameri

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to explain it each time, just changing oleron to SCM/oleron.

fig.colorbar(
cmap="oleron",
cmap="SCM/oleron",
# Colorbar placed outside the plot bounding box (J) at Middle Right (MR),
# offset (+o) by 1 cm horizontally and 0 cm vertically from anchor point,
# with a length/width (+w) of 7 cm by 0.5 cm and a box for NaN values (+n)
Expand All @@ -68,7 +68,7 @@
# Create a colorbar suitable for categorical data - hawaii
# Set up the colormap
pygmt.makecpt(
cmap="hawaii",
cmap="SCM/hawaii",
series=[0, 3, 1],
# Comma-separated string for the annotations of the colorbar
color_model="+cA,B,C,D",
Expand Down
4 changes: 2 additions & 2 deletions examples/gallery/embellishments/colorbars_multiple.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
# Activate the first panel so that the colormap created by the makecpt
# function is a panel-level CPT
with fig.set_panel(panel=0):
pygmt.makecpt(cmap="geo", series=[-8000, 8000])
pygmt.makecpt(cmap="gmt/geo", series=[-8000, 8000])
# "R?" means Winkel Tripel projection with map width automatically
# determined from the subplot width.
fig.grdimage(grid=grid_globe, projection="R?", region="g", frame="a")
fig.colorbar(frame=["a4000f2000", "x+lElevation", "y+lm"])
# Activate the second panel so that the colormap created by the makecpt
# function is a panel-level CPT
with fig.set_panel(panel=1):
pygmt.makecpt(cmap="globe", series=[-6000, 3000])
pygmt.makecpt(cmap="gmt/globe", series=[-6000, 3000])
# "M?" means Mercator projection with map width also automatically
# determined from the subplot width.
fig.grdimage(grid=grid_subset, projection="M?", region=subset_region, frame="a")
Expand Down
4 changes: 2 additions & 2 deletions examples/gallery/histograms/blockm.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
grid=grd,
region=region,
frame=["af", "+tMean earthquake depth inside each block"],
cmap="batlow",
cmap="SCM/batlow",
)
# Plot slightly transparent landmasses on top
fig.coast(land="darkgray", transparency=40)
Expand All @@ -52,7 +52,7 @@
grid=grd,
region=region,
frame=["af", "+tNumber of points inside each block"],
cmap="batlow",
cmap="SCM/batlow",
)
fig.coast(land="darkgray", transparency=40)
fig.plot(x=data.longitude, y=data.latitude, style="c0.3c", fill="white", pen="1p,black")
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/images/cross_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
grid_map = pygmt.datasets.load_earth_relief(resolution="10m", region=region_map)

# Plot the downloaded grid with color-coding based on the elevation
fig.grdimage(grid=grid_map, cmap="oleron")
fig.grdimage(grid=grid_map, cmap="SCM/oleron")

# Add a colorbar for the elevation
fig.colorbar(
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/images/grdclip.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
projection="M12c",
frame=["WSne+toriginal grid", "xa5f1", "ya2f1"],
)
fig.grdimage(grid=grid, cmap="oleron")
fig.grdimage(grid=grid, cmap="SCM/oleron")

# Shift plot origin of the second map by "width of the first map + 0.5 cm"
# in x-direction
Expand Down
4 changes: 2 additions & 2 deletions examples/gallery/images/grdgradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

# --------------- plotting the original Data Elevation Model -----------

pygmt.makecpt(cmap="gray", series=[200, 4000, 10])
pygmt.makecpt(cmap="gmt/gray", series=[200, 4000, 10])
fig.grdimage(
grid=grid,
projection="M12c",
Expand All @@ -45,7 +45,7 @@
# Shift plot origin of the second map by 12.5 cm in x-direction
fig.shift_origin(xshift="12.5c")

pygmt.makecpt(cmap="gray", series=[-1.5, 0.3, 0.01])
pygmt.makecpt(cmap="gmt/gray", series=[-1.5, 0.3, 0.01])
fig.grdimage(
grid=dgrid,
projection="M12c",
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/images/grdgradient_shading.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
fig = pygmt.Figure()

# Define a colormap to be used for topography
pygmt.makecpt(cmap="terra", series=[-7000, 7000])
pygmt.makecpt(cmap="gmt/terra", series=[-7000, 7000])

# Define figure configuration
pygmt.config(FONT_TITLE="10p,5", MAP_TITLE_OFFSET="1p", MAP_FRAME_TYPE="plain")
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/images/grdlandmask.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# use color_model="+cwater,land" to write the discrete color palette
# "batlow" in categorical format and add water/land as annotations for the
# colorbar.
pygmt.makecpt(cmap="batlow", series=(0, 1, 1), color_model="+cwater,land")
pygmt.makecpt(cmap="SCM/batlow", series=(0, 1, 1), color_model="+cwater,land")

fig.grdimage(grid=grid, cmap=True)
fig.colorbar(position="JMR+o0.5c/0c+w8c")
Expand Down
4 changes: 2 additions & 2 deletions examples/gallery/images/track_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
# Plot the earth relief grid on Cylindrical Stereographic projection, masking
# land areas
fig.basemap(region="g", projection="Cyl_stere/150/-20/15c", frame=True)
fig.grdimage(grid=grid, cmap="gray")
fig.grdimage(grid=grid, cmap="gmt/gray")
fig.coast(land="#666666")
# Plot the sampled bathymetry points using circles (c) of 0.15 cm size
# Points are colored using elevation values (normalized for visual purposes)
fig.plot(
x=track.longitude,
y=track.latitude,
style="c0.15c",
cmap="terra",
cmap="gmt/terra",
fill=(track.bathymetry - track.bathymetry.mean()) / track.bathymetry.std(),
)
fig.show()
2 changes: 1 addition & 1 deletion examples/gallery/lines/line_custom_cpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# Create a custom CPT with the batlow CPT and 10 discrete z-values (colors),
# use color_model="+c0-9" to write the color palette in categorical format and
# add labels (0) to (9) for the colorbar legend
pygmt.makecpt(cmap="batlow", series=[0, 9, 1], color_model="+c0-9")
pygmt.makecpt(cmap="SCM/batlow", series=[0, 9, 1], color_model="+c0-9")

# Plot 10 lines and set a different z-value for each line
for zvalue in range(10):
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/maps/choropleth_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
fig.basemap(region=[-19.5, 53, -37.5, 38], projection="M10c", frame="+n")

# First, we define the colormap to fill the polygons based on the "POP_EST" column.
pygmt.makecpt(cmap="acton", series=(0, 100), reverse=True)
pygmt.makecpt(cmap="SCM/acton", series=(0, 100), reverse=True)

# Next, we plot the polygons and fill them using the defined colormap. The target column
# is defined by the aspatial parameter.
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/symbols/bars.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

fig = pygmt.Figure()

pygmt.makecpt(cmap="roma", series=[0, 4, 1])
pygmt.makecpt(cmap="SCM/roma", series=[0, 4, 1])

with fig.subplot(
nrows=2,
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/symbols/points_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
# palette "inferno" in categorical format and add the species names as
# annotations for the colorbar
pygmt.makecpt(
cmap="inferno",
cmap="matplotlib/inferno",
# Use the minimum and maximum of the categorical number code
# to set the lowest_value and the highest_value of the CPT
series=(df.species.cat.codes.min(), df.species.cat.codes.max(), 1),
Expand Down
8 changes: 4 additions & 4 deletions examples/intro/02_contour_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
# "oleron" is used; a full list of CPTs can be found at :gmt-docs:`reference/cpts.html`.

fig = pygmt.Figure()
fig.grdimage(grid=grid, frame="a", projection="M10c", cmap="oleron")
fig.grdimage(grid=grid, frame="a", projection="M10c", cmap="SCM/oleron")
fig.show()


Expand All @@ -64,7 +64,7 @@
# :meth:`pygmt.Figure.grdimage`.

fig = pygmt.Figure()
fig.grdimage(grid=grid, frame="a", projection="M10c", cmap="oleron")
fig.grdimage(grid=grid, frame="a", projection="M10c", cmap="SCM/oleron")
fig.colorbar(frame=["a1000", "x+lElevation", "y+lm"])
fig.show()

Expand All @@ -85,7 +85,7 @@
# lines can be adjusted (separately) by specifying the desired ``pen``.

fig = pygmt.Figure()
fig.grdimage(grid=grid, frame="a", projection="M10c", cmap="oleron")
fig.grdimage(grid=grid, frame="a", projection="M10c", cmap="SCM/oleron")
fig.grdcontour(grid=grid, levels=500, annotation=1000)
fig.colorbar(frame=["a1000", "x+lElevation", "y+lm"])
fig.show()
Expand All @@ -100,7 +100,7 @@
# the ``shorelines`` parameter draws a border around the islands.

fig = pygmt.Figure()
fig.grdimage(grid=grid, frame="a", projection="M10c", cmap="oleron")
fig.grdimage(grid=grid, frame="a", projection="M10c", cmap="SCM/oleron")
fig.grdcontour(grid=grid, levels=500, annotation=1000)
fig.coast(shorelines="2p", land="lightgray")
fig.colorbar(frame=["a1000", "x+lElevation", "y+lm"])
Expand Down
6 changes: 3 additions & 3 deletions examples/tutorials/advanced/3d_perspective_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
# Set the surftype to "surface"
surftype="s",
# Set the CPT to "geo"
cmap="geo",
cmap="gmt/geo",
)
fig.show()

Expand All @@ -66,7 +66,7 @@
projection="M15c",
zsize="1.5c",
surftype="s",
cmap="geo",
cmap="gmt/geo",
plane=1000, # Set the plane elevation to 1,000 meters
facade_fill="gray", # Color the facade in "gray"
)
Expand All @@ -89,7 +89,7 @@
projection="M15c",
zsize="1.5c",
surftype="s",
cmap="geo",
cmap="gmt/geo",
plane=1000,
facade_fill="gray",
# Set the contour pen thickness to 0.1 points
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorials/advanced/contour_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
# :meth:`pygmt.Figure.colorbar` method.

fig = pygmt.Figure()
fig.grdimage(grid=grid, cmap="haxby", projection="M10c", frame=True)
fig.grdimage(grid=grid, cmap="gmt/haxby", projection="M10c", frame=True)
fig.grdcontour(grid=grid, annotation=1000, levels=250, limit=[-4000, -2000])
fig.colorbar(frame=["x+lelevation", "y+lm"])
fig.show()
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorials/advanced/draping_on_3d_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

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

fig.grdview(
projection="M12c", # Mercator projection with a width of 12 centimeters
Expand Down
8 changes: 4 additions & 4 deletions examples/tutorials/advanced/earth_relief.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@
# Using the *geo* CPT:

fig = pygmt.Figure()
fig.grdimage(grid=grid, projection="R12c", cmap="geo")
fig.grdimage(grid=grid, projection="R12c", cmap="gmt/geo")
fig.show()

# %%
# Using the *relief* CPT:

fig = pygmt.Figure()
fig.grdimage(grid=grid, projection="R12c", cmap="relief")
fig.grdimage(grid=grid, projection="R12c", cmap="gmt/relief")
fig.show()


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

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

Expand All @@ -96,7 +96,7 @@

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

Expand Down
2 changes: 1 addition & 1 deletion examples/tutorials/advanced/focal_mechanisms.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@
fig.coast(region="d", projection="N10c", land="lightgray", frame=True)

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

fig.meca(
Expand Down
8 changes: 4 additions & 4 deletions examples/tutorials/advanced/grid_equalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# Define figure configuration
pygmt.config(FORMAT_GEO_MAP="ddd.x", MAP_FRAME_TYPE="plain")
# Define the colormap for the figure
pygmt.makecpt(series=[500, 3540], cmap="turku")
pygmt.makecpt(series=[500, 3540], cmap="SCM/turku")
# Setup subplots with two panels
with fig.subplot(
nrows=1, ncols=2, figsize=("13.5c", "4c"), title="Digital Elevation Model"
Expand Down Expand Up @@ -104,7 +104,7 @@
# Define figure configuration
pygmt.config(FORMAT_GEO_MAP="ddd.x", MAP_FRAME_TYPE="plain")
# Define the colormap for the figure
pygmt.makecpt(series=[0, divisions, 1], cmap="lajolla")
pygmt.makecpt(series=[0, divisions, 1], cmap="SCM/lajolla")
# Setup subplots with two panels
with fig.subplot(
nrows=1, ncols=2, figsize=("13.5c", "4c"), title="Linear distribution"
Expand Down Expand Up @@ -154,7 +154,7 @@
# Define figure configuration
pygmt.config(FORMAT_GEO_MAP="ddd.x", MAP_FRAME_TYPE="plain")
# Define the colormap for the figure
pygmt.makecpt(series=[-4.5, 4.5], cmap="vik")
pygmt.makecpt(series=[-4.5, 4.5], cmap="SCM/vik")
# Setup subplots with two panels
with fig.subplot(
nrows=1, ncols=2, figsize=("13.5c", "4c"), title="Normal distribution"
Expand Down Expand Up @@ -218,7 +218,7 @@
# Define figure configuration
pygmt.config(FORMAT_GEO_MAP="ddd.x", MAP_FRAME_TYPE="plain")
# Define the colormap for the figure
pygmt.makecpt(series=[0, divisions, 1], cmap="lajolla")
pygmt.makecpt(series=[0, divisions, 1], cmap="SCM/lajolla")
# Setup subplots with two panels
with fig.subplot(
nrows=1, ncols=2, figsize=("13.5c", "4c"), title="Quadratic distribution"
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorials/advanced/working_with_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def view(central_lon):
fig = pygmt.Figure()
# Set up a colormap for the elevation in meters
pygmt.makecpt(
cmap="oleron",
cmap="SCM/oleron",
# minimum, maximum, step
series=[int(grd_relief.data.min()) - 1, int(grd_relief.data.max()) + 1, 100],
)
Expand Down
Loading
Loading