# Subduction in Central America

**URL:** <https://forum.generic-mapping-tools.org/t/subduction-in-central-america/5526>\
**Category:** Showcase\
**Created:** [November 13, 2024, 7:22pm UTC](https://forum.generic-mapping-tools.org/t/subduction-in-central-america/5526 "2024-11-13T19:22:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [November 13, 2024, 7:22pm UTC](https://forum.generic-mapping-tools.org/t/subduction-in-central-america/5526/1 "2024-11-13T19:22:02Z")

</div>

Another episode of the GMT 3D adventures. A figure with a 3D view of the subduction in Central America.

Sorry, this time I couldn’t do it with a one-liner.

```auto
# Get the depth of these three cities
Gm, Gt, SJ = grdtrack("cam_slab2_dep_02.24.18.grd", [260.862 19.4326; 269.492 14.64; 275.925 9.908], f=:g).data[:,3]

# Create cylinder markers
FV_Mx = cylinder(0.2, 140, np=18, center=(260.862, 19.4326, Gm));
FV_Gt = cylinder(0.2, -Gt, np=18, center=(269.492, 14.64, Gt));
FV_SJ = cylinder(0.2, -SJ, np=18, center=(275.925, 9.908, SJ));

# Convert the subduction slab grids into a triangular mesh
D = grid2tri("cam_slab2_dep_02.24.18.grd", "cam_slab2_thk_02.24.18.grd", geog=true);

plot3(D, p=(70,30), zlabel="Depth (km)", title="Subduction in Central America", frame=:autoXYZg)
colorbar!(pos=(justify=:TR, horizontal=true, offset=(1,-2)),)

# Plot the coastlines drapped on the subducting slab
plot3!(coast(region=D, dump=true, Z="cam_slab2_dep_02.24.18.grd"), f=:g)

plot3!(FV_Mx);	plot3!(FV_SJ);	plot3!(FV_Gt)
text!(mat2ds([260.862 19.4326 10; 275.925 9.908 10; 269.492 14.64 10],
             ["Mexico City", "San José", "Guatemala"]),
             f=:g, font=14, angle=110, noclip=true, outline=true, show=1)

```

 ![subduct](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/6/637b5e628dc410e718cce93933d086ca6b3e0b9c.jpeg)
