5
$\begingroup$

I have generated a relief map according to a method shown in Mathematica documentation, viz:

upperleft = GeoPosition[{36.843626, 13.916897}]

lowerright = GeoPosition[{35.710239, 15.37673}]

demdata = 
 Reverse[QuantityMagnitude[GeoElevationData[{upperleft, lowerright}]]]

ListPlot3D[demdata, AspectRatio -> (Divide @@ Dimensions[demdata]), 
 Boxed -> False, Mesh -> None, Axes -> False, Background -> Black, 
 ColorFunction -> ColorData["HypsometricTints"], 
 ColorFunctionScaling -> False]

enter image description here

I would like to add one or two particular contours at specific depths in the ocean areas, like at -150 feet and -300 feet. Is there a way to do that?

$\endgroup$
  • 8
    $\begingroup$ Replace the Mesh -> None with MeshFunctions -> {#3 &}, Mesh -> {{-150, -300}}. $\endgroup$ – user484 Nov 18 '15 at 22:23
  • $\begingroup$ @Rahul, looks like an answer to me. :) $\endgroup$ – J. M.'s technical difficulties Nov 19 '15 at 1:05
  • $\begingroup$ This is about adding SPECIFIC contour lines not contour lines in general. $\endgroup$ – Tyler Durden Nov 19 '15 at 5:27
4
$\begingroup$

@Rahul's comment nails it...

But what if you wanted a giant red slice raising from the water?

Your code, assigning the graph to variable: a:

upperleft = GeoPosition[{36.843626, 13.916897}];

lowerright = GeoPosition[{35.710239, 15.37673}];

demdata = 
 Reverse[QuantityMagnitude[GeoElevationData[{upperleftlowerright}]]];

a = ListPlot3D[demdata, 
    AspectRatio -> (Divide @@ Dimensions[demdata]), Boxed -> False, 
    Mesh -> None, Axes -> False, Background -> Black, 
    ColorFunction -> ColorData["HypsometricTints"], 
    ColorFunctionScaling -> False];

Now we generate a red slice inside of your graph a at varied depths:

g = ParallelTable[Show[a, ContourPlot3D[y == depth,
     {p, 1, Dimensions[demdata][[1]]},
     {s, 1, Dimensions[demdata][[2]]}, {y, -2000, 0}, 
     ContourStyle -> Opacity[.4, Lighter@Red]]], {depth, -2000, 0, 100}];

Export to Gif:

Red Slice

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.