API Reference
Front-Door Dispatcher
InteractiveGMT.iview — Function
iview(x; kwargs...)Front-door dispatcher over the Qt + VTK viewers. x may be:
- a
GMTgrid->view_grid - a
GMTimage->view_image(bare image: flat plane, top-down map) - a
GMTfv->view_fv(faceted z-colour + matching colorbar;color=:explicitfor baked colours) - a
GMTdataset/Vector{GMTdataset}-> points ->view_points; polygons ->view_fv(poly2fv(...)) - a
String->"grid"/"peaks"demo or a grid file ->view_grid; else a named solid from SOLIDS ->view_fv
With no argument, iview() opens an empty drag-and-drop launcher window: drop a grid / image / table file (anything GMT.gmtread reads) onto it — or onto any open viewer window — to open it in a new window.
E.g. iview("torus"), iview(GMT.peaks()), iview(poly_dataset), iview(torus(R=6)), iview(). Line geometry has no standalone window here — overlay it on a grid with add! instead.
iview() -> QtEmptyOpen an empty viewer window that acts as a drag-and-drop launcher: drop a grid, image, or table file (anything GMT.gmtread understands) onto it — or onto any open viewer window — and it is added to that window and listed in its "Scene Objects" panel. Returns a QtEmpty handle.
Grid Viewer
InteractiveGMT.view_grid — Function
view_grid(G::GMTgrid; cmap=:auto, drape=nothing, outside=:shademesh, outside_color=200,
title="i'GMT", geographic=nothing)Show a GMT.jl grid in the Qt + VTK viewer. Returns a QtFigure handle immediately; the window stays live while you keep using the REPL. Pass the handle to add! to add elements (lines/points) to this window later. cmap is any GMT colormap name (e.g. :geo, :turbo, :rainbow, :roma), applied LINEARLY over the grid's z range via makecpt; pass nothing for the built-in ramp. The default :auto picks :geo for topo/bathymetry grids (those GMT tags with cpt == "geo") and :turbo for everything else. drape is an optional GMTimage textured over the surface instead of the CPT colouring.
outside controls the grid area the drape image does NOT cover (mirrors GMTF3D):
:shademesh(default) — flatoutside_colorfill (uncovered reads as the shaded surface).:shade— flatoutside_colorfill.:transparent— see-through; the CPT-coloured base surface shows through.
outside_color is a grey 0-255 int or an (r,g,b) tuple (0-255 ints or 0-1 floats).
The surface mesh (wire edges) is HIDDEN by default; press e in the viewer to toggle it on/off (works on both the base surface and any drape).
triangulate (default true) builds the surface from 2 triangles per grid cell (diagonals, GMTF3D-style); pass false for a single quad per cell.
data overlays a GMTdataset (single or multi-segment Vector{GMTdataset}) on the surface, drawn as mode=:lines (default) or mode=:points. Its z comes from column 3 if present, else is sampled off the grid so it drapes on the relief. data_color is a grey 0-255 int, an (r,g,b) (0-255 ints or 0-1 floats), or nothing (black lines / red points). data_size sets the line width or point size in px (0 = default). Right-click an overlay for a context menu to change its colour, line style/width (lines) or size and round/square (points).
vcurtain hangs a Fledermaus-style vertical image curtain (seismic / midwater profile) along an XY track through the scene — one spec NamedTuple, or a vector of them: (; image, path, zrange, spacing=:distance, flipv=false, clip=false, clip_n=300) (same fields as add_curtain!). E.g. view_grid(G; vcurtain=(; image="sect.jpg", path=track, zrange=(-10000,0), clip=true)).
geographic is auto-detected (override with true/false). For geographic grids the vertical exaggeration is referenced to metres (1°lat ≈ 111111 m, 1°lon = that × cos(mid-lat)); z assumed metres.
InteractiveGMT.view_image — Function
view_image(I::GMTimage; title="i'GMT", geographic=nothing, axes=nothing)Show a bare GMTimage (no elevation) in the viewer: a flat plane textured with the image, opened maximized in a top-down orthographic map. Returns a QtImage handle immediately (the window stays live while you use the REPL). The status-bar readout shows the pixel colour (rgb = R G B) under the cursor instead of a z value. geographic is auto-detected (GMT.isgeog); override with true/false. Also reachable as iview(I).
Overlays
InteractiveGMT.add! — Function
add!(fig::QtFigure, data; mode=:lines, color=nothing, size=0)Add elements to an existing viewer window fig (returned by view_grid). data is a GMTdataset (single or multi-segment Vector{GMTdataset}), or an N×2/N×3 matrix, drawn as mode=:lines (default) or mode=:points. Elements with no z column are draped on the figure's surface. color is a name (:red, :black, ...), a 0-255 grey, an (r,g,b) (0-255 ints or 0-1 floats), or nothing (black lines / red points). size is the line width or point size in px (0 = default). Returns fig.
(Named add!, not plot!, to avoid clashing with GMT.jl's plot!.)
add!(p::QtXYPlot, x, y; name="", color=nothing, linewidth=0) -> QtXYPlotAdd another (x, y) line to an open X,Y plot window. Same keyword semantics as xyplot.
Curtains
InteractiveGMT.add_curtain! — Function
add_curtain!(fig::QtFigure, path; image, zrange, spacing=:distance, flipv=false,
clip=false, clip_n=300)Hang a Fledermaus-style vertical image curtain on the wall that follows the XY path through fig's scene (a seismic / midwater profile). Returns fig.
path— anN×2matrix (orGMTdataset) of the track in the grid's XY coords (N=2= a straight two-point curtain; more points weave).image— aGMTimage(in-memory) OR a file-pathString(gmtread).zrange=(zmin,zmax)— the curtain's vertical extent in TRUE z units (same as the grid).spacing—:distance(image stretched by chord length, default) or:simple(even per point).flipv— invert the image's vertical sense (default first scanline → top).clip— cut the curtain's top edge to the grid surface so the wall hugs the relief (the image above the seafloor is dropped). Densifies the track toclip_ncolumns and samplesfig.Galong it.
The curtain shares the surface's vertical scale, so it rises/falls with the relief when the vertical exaggeration changes, and it appears in the Scene Objects panel (hideable).
Point Clouds
InteractiveGMT.view_points — Function
view_points(D; cmap=:turbo, pointsize=4, pickcolor=(0.83,0.83,0.83),
geographic=nothing, title=...)Show a point cloud — a GMTdataset or an N×≥3 matrix of x y z [...] rows — in the Qt + VTK viewer, colouring each point by its z through the GMT colormap cmap (any GMT name, e.g. :turbo, :roma, :geo; nothing = the built-in ramp). Returns a QtPoints handle immediately; the window stays live while you keep using the REPL.
Ctrl+right-drag a box over the cloud to select points (TOGGLE — re-dragging the same box deselects; Ctrl+Z undoes the last change). Plain right-drag stays the dolly. The selected points are highlighted in pickcolor and kept for you — read them back with selection, which returns a copy of the picked x y z [...] rows (or nothing).
pointsize— point size in px.pickcolor— highlight colour for selected points: an(r,g,b)(0-255 ints or 0-1 floats) or a grey number.geographic— auto-detected for aGMTdataset(override withtrue/false); treats x,y as degrees and z as metres for a physically-true vertical scale.
Selection
InteractiveGMT.selection — Function
selection(fig::QtPoints) -> MatrixReturn a copy of the point-cloud rows currently selected with Ctrl+right-drag in the viewer (x y z [...]), or an EMPTY matrix (0 rows, same columns) if none are selected (or the window is closed). Test with isempty.
Solids
InteractiveGMT.view_fv — Function
view_fv(name::AbstractString; color=true, cmap=:turbo, edges=false, geographic=nothing,
title="", solid_kwargs...)Show a NAMED GMT solid from the SOLIDS catalogue ("cube", "sphere", "torus", "icosahedron", "octahedron", "dodecahedron", "tetrahedron", "cylinder", "revolve", "loft", "extrude"). The solid takes its OWN parameters — any kwarg that is NOT a viewer keyword is forwarded untouched to the GMT generator:
view_fv("cube"; r=3) # r = circumradius (centre→vertex)
view_fv("sphere"; n=4) # sphere's own subdivision level
view_fv("torus"; R=8, nx=200, edges=true)
view_fv("revolve"; curve=mycurve) # your own profile (else a demo profile)color behaves as in view_fv(::GMTfv): true (default) = FACETED per-face colour by mean z through cmap with a MATCHING colorbar; false = smooth per-vertex z; :explicit = the solid's own baked colours (no colorbar). The remaining viewer kwargs (cmap, edges, geographic, title) behave the same.
InteractiveGMT.poly2fv — Function
poly2fv(D::Vector{<:GMTdataset}; cmap=:turbo, zscale=:auto, vfrac=0.2, vexag=:auto,
isgeog=false, ncolor=256, triangulate=false) -> GMTfvFold a vector of closed 3-D polygons into a single coloured GMTfv ready for view_fv — one mesh face per polygon, any corner count. Each polygon needs x y z columns; a repeated closing vertex is dropped. Faces are coloured by their mean z through the GMT colormap cmap. Pass triangulate=true to fan-split every polygon into triangles (concave / non-planar polys).
X,Y Plot
InteractiveGMT.xyplot — Function
xyplot(x, y; name="", color=nothing, linewidth=0, title="", xlabel="X", ylabel="Y") -> QtXYPlotOpen a standalone X,Y plot window and draw the (x, y) series. y may be a matrix whose columns are separate lines sharing the same x. color accepts a name (:red, "blue"), a 0–255 / 0–1 triple, or nothing for the default. xlabel/ylabel set the axis titles. Returns a live QtXYPlot handle; add more lines with add!. Non-blocking.
t = range(0, 4π; length=400) |> collect
p = xyplot(t, sin.(t); name="sin", title="demo", ylabel="amplitude")
add!(p, t, cos.(t); name="cos", color=:blue)InteractiveGMT.clear! — Function
clear!(p::QtXYPlot) -> QtXYPlotRemove every series from an open X,Y plot window.
Time & Log Axes
InteractiveGMT.xtime! — Function
xtime!(p::QtXYPlot, mode) -> QtXYPlotFormat the X axis as time, reading X as Unix epoch seconds. mode is :linear (plain numbers), :date (auto by span), :date_ymd (yyyy-mm-dd), :time (HH:MM), :decyear (decimal year) or :doy (decimal day-of-year). Ticks auto-update on zoom/pan.
InteractiveGMT.logscale! — Function
logscale!(p::QtXYPlot; x=nothing, y=nothing) -> QtXYPlotSet base-10 log scaling on the X and/or Y axis (true = log, false = linear, nothing = leave unchanged). Data on a log axis must be positive.
Stick Diagrams
InteractiveGMT.stickplot — Function
stickplot(t, u, v; scale=:auto, color=nothing, title="Stick diagram", kwargs...) -> QtXYPlot
stickplot(t, azimuth; mag=nothing, kwargs...) -> QtXYPlotDraw a stick (vector) diagram: at each t a vector is plotted from the y=0 baseline. Give the vectors as (u, v) components, or as azimuth degrees (oceanographic: 0° = up/North, clockwise) with optional mag (default 1). scale sizes the sticks (:auto ≈ 5 % of the time span per full-magnitude vector). Returns a QtXYPlot; extra keywords (xlabel, ylabel, xtime, name) pass through.
t = collect(0:0.5:48) # hours
az = 90 .+ 60 .* sin.(2π .* t ./ 12) # tide-turning current direction
stickplot(t, az; mag=1 .+ 0.3 .* cos.(2π .* t ./ 12), title="Current sticks", xlabel="hour")Utilities
InteractiveGMT.isalive — Function
True while the figure's window is still open (closing it invalidates the handle).
InteractiveGMT.save_png — Function
save_png(path) -> BoolSave a PNG of the most-recently-opened viewer window to path. Returns true on success.
InteractiveGMT.wait_windows — Function
wait_windows()Block (yielding, so the Qt pump keeps running) until every viewer window is closed. Useful at the tail of a julia script.jl run, where there is no REPL to keep the process alive.
InteractiveGMT.stereo! — Function
stereo!(fig, on=-1) -> BoolToggle red/cyan anaglyph stereo on a viewer window (use cheap red/cyan 3-D glasses to see real depth on the relief). on=true enables, on=false disables, default -1 flips the current state. Sets the stereo type to anaglyph so it actually renders on a normal monitor. Returns the new state (true = on). fig is any viewer handle (QtFigure/QtPoints/QtFV).
Data Viewing
InteractiveGMT.show_table — Function
show_table(fig, data; name="")Show data in the window's Data Viewer spreadsheet tab and bring that tab forward. fig is any viewer handle (QtFigure/QtPoints/QtFV); data is a GMTdataset (single or multi-segment Vector{GMTdataset}), a plain matrix, or a vector. name labels the tab (defaults to the dataset's header / "matrix" / "vector"). Returns fig.
Types
QtFigure
Handle for a 3-D grid/image window.
fig = view_grid(G) # Returns QtFigureQtPoints
Handle for a point cloud window.
fig = view_points(D) # Returns QtPointsQtFV
Handle for a solid/mesh window.
fig = view_fv("torus") # Returns QtFVQtImage
Handle for an image window.
QtEmpty
Handle for an empty launcher window.
QtXYPlot
Handle for an X,Y plot window.
fig = xyplot([x y]) # Returns QtXYPlotIndex
InteractiveGMT.NO_CRSInteractiveGMT.CRSInteractiveGMT.add!InteractiveGMT.add!InteractiveGMT.add!InteractiveGMT.add_curtain!InteractiveGMT.add_curtain!InteractiveGMT.add_symbols!InteractiveGMT.clear!InteractiveGMT.clear!InteractiveGMT.crs_fromInteractiveGMT.hascrsInteractiveGMT.isaliveInteractiveGMT.isaliveInteractiveGMT.iviewInteractiveGMT.iviewInteractiveGMT.iviewInteractiveGMT.logscale!InteractiveGMT.logscale!InteractiveGMT.poly2fvInteractiveGMT.poly2fvInteractiveGMT.profile_to_xyplotInteractiveGMT.rtp3dInteractiveGMT.save_pngInteractiveGMT.save_pngInteractiveGMT.selectionInteractiveGMT.selectionInteractiveGMT.show_tableInteractiveGMT.show_tableInteractiveGMT.stereo!InteractiveGMT.stereo!InteractiveGMT.stickplotInteractiveGMT.stickplotInteractiveGMT.update!InteractiveGMT.view_demoInteractiveGMT.view_fvInteractiveGMT.view_fvInteractiveGMT.view_gridInteractiveGMT.view_gridInteractiveGMT.view_imageInteractiveGMT.view_imageInteractiveGMT.view_pointsInteractiveGMT.view_pointsInteractiveGMT.wait_windowsInteractiveGMT.wait_windowsInteractiveGMT.xtime!InteractiveGMT.xtime!InteractiveGMT.xyplotInteractiveGMT.xyplot
Internal
InteractiveGMT.NO_CRS — Constant
The empty (unreferenced) CRS.
InteractiveGMT.CRS — Type
CRS(proj4, wkt, epsg)A coordinate reference system in its three interchangeable forms. An empty proj4 and wkt with epsg == 0 means UNREFERENCED data. Build one from a GMT object with crs_from.
InteractiveGMT.add! — Method
add!(fig::QtFigure, data; mode=:lines, color=nothing, size=0)Add elements to an existing viewer window fig (returned by view_grid). data is a GMTdataset (single or multi-segment Vector{GMTdataset}), or an N×2/N×3 matrix, drawn as mode=:lines (default) or mode=:points. Elements with no z column are draped on the figure's surface. color is a name (:red, :black, ...), a 0-255 grey, an (r,g,b) (0-255 ints or 0-1 floats), or nothing (black lines / red points). size is the line width or point size in px (0 = default). Returns fig.
(Named add!, not plot!, to avoid clashing with GMT.jl's plot!.)
InteractiveGMT.add! — Method
add!(p::QtXYPlot, x, y; name="", color=nothing, linewidth=0) -> QtXYPlotAdd another (x, y) line to an open X,Y plot window. Same keyword semantics as xyplot.
InteractiveGMT.add_curtain! — Method
add_curtain!(fig::QtFigure, path; image, zrange, spacing=:distance, flipv=false,
clip=false, clip_n=300)Hang a Fledermaus-style vertical image curtain on the wall that follows the XY path through fig's scene (a seismic / midwater profile). Returns fig.
path— anN×2matrix (orGMTdataset) of the track in the grid's XY coords (N=2= a straight two-point curtain; more points weave).image— aGMTimage(in-memory) OR a file-pathString(gmtread).zrange=(zmin,zmax)— the curtain's vertical extent in TRUE z units (same as the grid).spacing—:distance(image stretched by chord length, default) or:simple(even per point).flipv— invert the image's vertical sense (default first scanline → top).clip— cut the curtain's top edge to the grid surface so the wall hugs the relief (the image above the seafloor is dropped). Densifies the track toclip_ncolumns and samplesfig.Galong it.
The curtain shares the surface's vertical scale, so it rises/falls with the relief when the vertical exaggeration changes, and it appears in the Scene Objects panel (hideable).
InteractiveGMT.add_symbols! — Method
add_symbols!(handle, x, y; z=0, symbol=:c, size=8, sizeunit=:px,
fill=:yellow, edge=:black, edgewidth=1.0, filled=true)Stamp a screen-constant symbol layer at points (x, y[, z]) (TRUE data coords) on an existing viewer handle (a QtFigure or a raw Scene* Ptr). symbol is a friendly name (:circle, :square, :triangle, :itriangle, :diamond, :hexagon, :pentagon, :octagon, :star, :cross, :plus, :dash, :sphere, :cube) or a 1-char GMT code. :sphere/:cube are true 3-D, lit volumes (visible from any angle, e.g. edge-on in perspective) — every other shape is a flat, unlit XY glyph. size is on screen, in :px or :pt. fill and edge accept any colour _ovl_color understands (name Symbol/String, 0-1 or 0-255 tuple). Symbols stay the same pixel size at any zoom. Returns true if the layer was added.
InteractiveGMT.clear! — Method
clear!(p::QtXYPlot) -> QtXYPlotRemove every series from an open X,Y plot window.
InteractiveGMT.crs_from — Method
crs_from(O; geographic=false) -> CRSBuild the CRS for a GMT object (GMTgrid, GMTimage, GMTdataset, GMTfv, …): read whatever PROJ4 / WKT / EPSG it carries, then derive the missing forms with GMT.jl's converters, using PROJ4 as the pivot. geographic=true resolves a plain lon/lat object with no explicit projection to WGS84 (EPSG 4326). Returns NO_CRS for unreferenced data.
InteractiveGMT.hascrs — Method
True if this CRS carries any referencing at all.
InteractiveGMT.isalive — Method
True while the figure's window is still open (closing it invalidates the handle).
InteractiveGMT.iview — Method
iview(x; kwargs...)Front-door dispatcher over the Qt + VTK viewers. x may be:
- a
GMTgrid->view_grid - a
GMTimage->view_image(bare image: flat plane, top-down map) - a
GMTfv->view_fv(faceted z-colour + matching colorbar;color=:explicitfor baked colours) - a
GMTdataset/Vector{GMTdataset}-> points ->view_points; polygons ->view_fv(poly2fv(...)) - a
String->"grid"/"peaks"demo or a grid file ->view_grid; else a named solid from SOLIDS ->view_fv
With no argument, iview() opens an empty drag-and-drop launcher window: drop a grid / image / table file (anything GMT.gmtread reads) onto it — or onto any open viewer window — to open it in a new window.
E.g. iview("torus"), iview(GMT.peaks()), iview(poly_dataset), iview(torus(R=6)), iview(). Line geometry has no standalone window here — overlay it on a grid with add! instead.
InteractiveGMT.iview — Method
iview() -> QtEmptyOpen an empty viewer window that acts as a drag-and-drop launcher: drop a grid, image, or table file (anything GMT.gmtread understands) onto it — or onto any open viewer window — and it is added to that window and listed in its "Scene Objects" panel. Returns a QtEmpty handle.
InteractiveGMT.logscale! — Method
logscale!(p::QtXYPlot; x=nothing, y=nothing) -> QtXYPlotSet base-10 log scaling on the X and/or Y axis (true = log, false = linear, nothing = leave unchanged). Data on a log axis must be positive.
InteractiveGMT.poly2fv — Method
poly2fv(D::Vector{<:GMTdataset}; cmap=:turbo, zscale=:auto, vfrac=0.2, vexag=:auto,
isgeog=false, ncolor=256, triangulate=false) -> GMTfvFold a vector of closed 3-D polygons into a single coloured GMTfv ready for view_fv — one mesh face per polygon, any corner count. Each polygon needs x y z columns; a repeated closing vertex is dropped. Faces are coloured by their mean z through the GMT colormap cmap. Pass triangulate=true to fan-split every polygon into triangles (concave / non-planar polys).
InteractiveGMT.profile_to_xyplot — Method
profile_to_xyplot(fig) -> QtXYPlotOpen the current Profile of a 3-D viewer window fig (a Ctrl+left-drag elevation profile, or a downloaded tide series — whatever its bottom-dock Profile panel shows) in a standalone X,Y plot tool window, with its Object Manager, Analysis menu and save. The programmatic twin of the panel's right-click "Open in X,Y plot tool". fig is any 3-D viewer handle (QtFigure/…).
InteractiveGMT.rtp3d — Method
fout, k = rtp3d(f3d, incl_fld, decl_fld, incl_mag, decl_mag; component=0)Reduce a magnetic field anomaly map f3d to the pole, given the inclination/declination (degrees) of the ambient field (incl_fld, decl_fld) and of the magnetization (incl_mag, decl_mag).
component selects an alternative output instead of the plain RTP: 1 = X/North, 2 = Y/East, 3 = Z/Up component. Default 0 is the RTP.
Returns the transformed grid fout and the wavenumber array k.
InteractiveGMT.save_png — Method
save_png(path) -> BoolSave a PNG of the most-recently-opened viewer window to path. Returns true on success.
InteractiveGMT.selection — Method
selection(fig::QtPoints) -> MatrixReturn a copy of the point-cloud rows currently selected with Ctrl+right-drag in the viewer (x y z [...]), or an EMPTY matrix (0 rows, same columns) if none are selected (or the window is closed). Test with isempty.
InteractiveGMT.show_table — Method
show_table(fig, data; name="")Show data in the window's Data Viewer spreadsheet tab and bring that tab forward. fig is any viewer handle (QtFigure/QtPoints/QtFV); data is a GMTdataset (single or multi-segment Vector{GMTdataset}), a plain matrix, or a vector. name labels the tab (defaults to the dataset's header / "matrix" / "vector"). Returns fig.
InteractiveGMT.stereo! — Function
stereo!(fig, on=-1) -> BoolToggle red/cyan anaglyph stereo on a viewer window (use cheap red/cyan 3-D glasses to see real depth on the relief). on=true enables, on=false disables, default -1 flips the current state. Sets the stereo type to anaglyph so it actually renders on a normal monitor. Returns the new state (true = on). fig is any viewer handle (QtFigure/QtPoints/QtFV).
InteractiveGMT.stickplot — Method
stickplot(t, u, v; scale=:auto, color=nothing, title="Stick diagram", kwargs...) -> QtXYPlot
stickplot(t, azimuth; mag=nothing, kwargs...) -> QtXYPlotDraw a stick (vector) diagram: at each t a vector is plotted from the y=0 baseline. Give the vectors as (u, v) components, or as azimuth degrees (oceanographic: 0° = up/North, clockwise) with optional mag (default 1). scale sizes the sticks (:auto ≈ 5 % of the time span per full-magnitude vector). Returns a QtXYPlot; extra keywords (xlabel, ylabel, xtime, name) pass through.
t = collect(0:0.5:48) # hours
az = 90 .+ 60 .* sin.(2π .* t ./ 12) # tide-turning current direction
stickplot(t, az; mag=1 .+ 0.3 .* cos.(2π .* t ./ 12), title="Current sticks", xlabel="hour")InteractiveGMT.update! — Method
InteractiveGMT.update!()Pull the latest InteractiveGMT source in place (fast-forward only) and rebuild the binaries. Only works for a ] dev-installed checkout — a plain Pkg.add install should use Pkg.update("InteractiveGMT") instead.
InteractiveGMT.view_demo — Method
Show the built-in synthetic demo surface (no grid needed).
InteractiveGMT.view_fv — Method
view_fv(name::AbstractString; color=true, cmap=:turbo, edges=false, geographic=nothing,
title="", solid_kwargs...)Show a NAMED GMT solid from the SOLIDS catalogue ("cube", "sphere", "torus", "icosahedron", "octahedron", "dodecahedron", "tetrahedron", "cylinder", "revolve", "loft", "extrude"). The solid takes its OWN parameters — any kwarg that is NOT a viewer keyword is forwarded untouched to the GMT generator:
view_fv("cube"; r=3) # r = circumradius (centre→vertex)
view_fv("sphere"; n=4) # sphere's own subdivision level
view_fv("torus"; R=8, nx=200, edges=true)
view_fv("revolve"; curve=mycurve) # your own profile (else a demo profile)color behaves as in view_fv(::GMTfv): true (default) = FACETED per-face colour by mean z through cmap with a MATCHING colorbar; false = smooth per-vertex z; :explicit = the solid's own baked colours (no colorbar). The remaining viewer kwargs (cmap, edges, geographic, title) behave the same.
InteractiveGMT.view_grid — Method
view_grid(G::GMTgrid; cmap=:auto, drape=nothing, outside=:shademesh, outside_color=200,
title="i'GMT", geographic=nothing)Show a GMT.jl grid in the Qt + VTK viewer. Returns a QtFigure handle immediately; the window stays live while you keep using the REPL. Pass the handle to add! to add elements (lines/points) to this window later. cmap is any GMT colormap name (e.g. :geo, :turbo, :rainbow, :roma), applied LINEARLY over the grid's z range via makecpt; pass nothing for the built-in ramp. The default :auto picks :geo for topo/bathymetry grids (those GMT tags with cpt == "geo") and :turbo for everything else. drape is an optional GMTimage textured over the surface instead of the CPT colouring.
outside controls the grid area the drape image does NOT cover (mirrors GMTF3D):
:shademesh(default) — flatoutside_colorfill (uncovered reads as the shaded surface).:shade— flatoutside_colorfill.:transparent— see-through; the CPT-coloured base surface shows through.
outside_color is a grey 0-255 int or an (r,g,b) tuple (0-255 ints or 0-1 floats).
The surface mesh (wire edges) is HIDDEN by default; press e in the viewer to toggle it on/off (works on both the base surface and any drape).
triangulate (default true) builds the surface from 2 triangles per grid cell (diagonals, GMTF3D-style); pass false for a single quad per cell.
data overlays a GMTdataset (single or multi-segment Vector{GMTdataset}) on the surface, drawn as mode=:lines (default) or mode=:points. Its z comes from column 3 if present, else is sampled off the grid so it drapes on the relief. data_color is a grey 0-255 int, an (r,g,b) (0-255 ints or 0-1 floats), or nothing (black lines / red points). data_size sets the line width or point size in px (0 = default). Right-click an overlay for a context menu to change its colour, line style/width (lines) or size and round/square (points).
vcurtain hangs a Fledermaus-style vertical image curtain (seismic / midwater profile) along an XY track through the scene — one spec NamedTuple, or a vector of them: (; image, path, zrange, spacing=:distance, flipv=false, clip=false, clip_n=300) (same fields as add_curtain!). E.g. view_grid(G; vcurtain=(; image="sect.jpg", path=track, zrange=(-10000,0), clip=true)).
geographic is auto-detected (override with true/false). For geographic grids the vertical exaggeration is referenced to metres (1°lat ≈ 111111 m, 1°lon = that × cos(mid-lat)); z assumed metres.
InteractiveGMT.view_image — Method
view_image(I::GMTimage; title="i'GMT", geographic=nothing, axes=nothing)Show a bare GMTimage (no elevation) in the viewer: a flat plane textured with the image, opened maximized in a top-down orthographic map. Returns a QtImage handle immediately (the window stays live while you use the REPL). The status-bar readout shows the pixel colour (rgb = R G B) under the cursor instead of a z value. geographic is auto-detected (GMT.isgeog); override with true/false. Also reachable as iview(I).
InteractiveGMT.view_points — Method
view_points(D; cmap=:turbo, pointsize=4, pickcolor=(0.83,0.83,0.83),
geographic=nothing, title=...)Show a point cloud — a GMTdataset or an N×≥3 matrix of x y z [...] rows — in the Qt + VTK viewer, colouring each point by its z through the GMT colormap cmap (any GMT name, e.g. :turbo, :roma, :geo; nothing = the built-in ramp). Returns a QtPoints handle immediately; the window stays live while you keep using the REPL.
Ctrl+right-drag a box over the cloud to select points (TOGGLE — re-dragging the same box deselects; Ctrl+Z undoes the last change). Plain right-drag stays the dolly. The selected points are highlighted in pickcolor and kept for you — read them back with selection, which returns a copy of the picked x y z [...] rows (or nothing).
pointsize— point size in px.pickcolor— highlight colour for selected points: an(r,g,b)(0-255 ints or 0-1 floats) or a grey number.geographic— auto-detected for aGMTdataset(override withtrue/false); treats x,y as degrees and z as metres for a physically-true vertical scale.
InteractiveGMT.wait_windows — Method
wait_windows()Block (yielding, so the Qt pump keeps running) until every viewer window is closed. Useful at the tail of a julia script.jl run, where there is no REPL to keep the process alive.
InteractiveGMT.xtime! — Method
xtime!(p::QtXYPlot, mode) -> QtXYPlotFormat the X axis as time, reading X as Unix epoch seconds. mode is :linear (plain numbers), :date (auto by span), :date_ymd (yyyy-mm-dd), :time (HH:MM), :decyear (decimal year) or :doy (decimal day-of-year). Ticks auto-update on zoom/pan.
InteractiveGMT.xyplot — Method
xyplot(x, y; name="", color=nothing, linewidth=0, title="", xlabel="X", ylabel="Y") -> QtXYPlotOpen a standalone X,Y plot window and draw the (x, y) series. y may be a matrix whose columns are separate lines sharing the same x. color accepts a name (:red, "blue"), a 0–255 / 0–1 triple, or nothing for the default. xlabel/ylabel set the axis titles. Returns a live QtXYPlot handle; add more lines with add!. Non-blocking.
t = range(0, 4π; length=400) |> collect
p = xyplot(t, sin.(t); name="sin", title="demo", ylabel="amplitude")
add!(p, t, cos.(t); name="cos", color=:blue)