1
$\begingroup$

I would like to get a picture of a contour map like this: plot

I tried to modify the following code to remove the filled color on the contour map. So far I didn't succeed.

 contourPotentialPlot1 = ContourPlot[-3600. h^2 + 0.02974 h^4 - 5391.90 s^2 + 
   0.275 h^2 s^2 + 0.125 s^4, {h, -400, 400}, {s, -300, 300}, 
 PlotRange -> {-1.4*10^8, 2*10^7}, Contours -> 15, Axes -> False, 
 PlotPoints -> 30, PlotRangePadding -> 0, Frame -> False, ColorFunction -> "DarkRainbow"];

potential1 = Plot3D[-3600. h^2 + 0.02974 h^4 - 5391.90 s^2 + 0.275 h^2 s^2 + 
    0.125 s^4, {h, -400, 400}, {s, -300, 300}, 
   PlotRange -> {-1.4*10^8, 2*10^7}, ClippingStyle -> None, 
   MeshFunctions -> {#3 &}, Mesh -> 15, MeshStyle -> Opacity[.5], 
   MeshShading -> {{Opacity[.3], Blue}, {Opacity[.8], Orange}}, Lighting -> "Neutral"];

level = -1.2 10^8; gr = Graphics3D[{Texture[contourPotentialPlot1], EdgeForm[], 
Polygon[{{-400, -300, level}, {400, -300, level}, {400, 300, level}, {-400, 300, level}}, 
VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}, Lighting -> "Neutral"];

Show[potential1, gr, PlotRange -> All, BoxRatios -> {1, 1, .6}, FaceGrids -> {Back, Left}]

If we run the above code we would get a picture like this: plot

$\endgroup$
1
  • $\begingroup$ You neglected to mention that the pictures came from this answer. Next time, if you are giving code you did not write yourself, please link to the original source. $\endgroup$ Feb 23, 2021 at 21:38

1 Answer 1

1
$\begingroup$

ContourShading -> None and remove ColorFunction -> "DarkRainbow"

contourPotentialPlot1 = 
  ContourPlot[-3600. h^2 + 0.02974 h^4 - 5391.90 s^2 + 
    0.275 h^2 s^2 + 0.125 s^4, {h, -400, 400}, {s, -300, 300}, 
   PlotRange -> {-1.4*10^8, 2*10^7}, Contours -> 15, Axes -> False, 
   PlotPoints -> 30, PlotRangePadding -> 0, Frame -> False, 
   ContourShading -> None];
$\endgroup$
1
  • 1
    $\begingroup$ Thanks alot. It works. $\endgroup$
    – Hana
    Feb 23, 2021 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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