Grid Viewer

Opening Grids

View a GMT grid surface:

using InteractiveGMT

G = GMT.peaks()
fig = viz(G)

Options

OptionDescription
cmapColormap name (e.g., "relief", "geo", "etc")
veVertical exaggeration (default: 1)
drapeImage to drape over surface
nameName in Scene Objects
shadingEnable PBR lighting (default: true)
edgesShow mesh edges (default: false)

Examples

# With colormap
fig = viz(G; cmap="relief")

# With image drape
I = gmtread("satellite.tif")
fig = viz(G; drape=I)
MouseAction
Left-dragRotate view
Middle-dragPan
Scroll wheelZoom
Right-clickContext menu

Keyboard: e toggles mesh edges.

Colormaps

Available named colormaps: relief, geo, geo2, dem, mbio, world, Byrne, circular, polar, etc, jet, no_green

fig = viz(G; cmap="my_colors.cpt")  # Custom CPT file

Right-click "Color Bar" in Scene Objects to change colormap interactively.

Hillshade

Illuminate relief like a shaded map:

Menu: View → Hillshade Lambert or Hillshade grdimage

Vertical Exaggeration

Drag the blue ring on the gizmo, or click the VE ×… chip in the status bar

Adding Overlays

Add line or point overlays to a live grid:

Line Overlays

# Add coastline
coast = gmtread("coastline.gmt")
add!(fig, coast; mode=:lines, color="black", size=1.5)

Point Overlays

# Add stations
stations = gmtread("stations.txt")
add!(fig, stations; mode=:points, color="red", size=10)

Image Drape

Drape a georeferenced image over the terrain:

fig = viz(G; drape=I)

Curtains

Hang a vertical seismic profile:

# path: the track (N×2, the grid's XY), image: a GMTimage or file, zrange: its vertical extent
add_curtain!(fig, [x0 y0; x1 y1]; image="seismic.png", zrange=(-4000, 0))

Saving

save_png(fig, "output.png")

Or File → Save Grid / Save Image menu.