2
$\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$
2
  • $\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
  • $\begingroup$ Whenever you’re in doubt, assume you’re not the first to want to try whatever it is you’re trying to do, and look up the documentation for the function you’re using. In the documentation scroll to the options section and expand the available built-in options for the functions to see what modifications to the defaults are possible. I often fall into the trap of thinking “I want to do this and I’m sure this is a strange obscure thing to do”. But I’m most often wrong and the exact thing I’m looking for is in the help docs (press F2 when the function is highlighted); they’re really useful, I’ve ba $\endgroup$
    – NBD90
    Dec 14, 2022 at 12:53

1 Answer 1

2
$\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 and acknowledge you have read our privacy policy.

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