3

Basically, I want to make this 3-D Plot transparent. I've already tried Opacity[]. I also want to change its color to e.g. light blue.

α= 1;
β= 1;
tmp = 0.1316;
ρ= 0.01;
t = -1.5;

fe[m_, p_] := 
 1/2*(t - 1)*p^2 + 1/4*p^4 + (1/2*\α^2*β*m^2*(t - tmp)) + 
  1/4 α^2*(β)*(m^4) + 1/2*(\ρ*(p^2)*(m^2))

Show[SliceContourPlot3D[-z, 
  z == fe[m, p], {m, -3, 3}, {p, -3, 3}, {z, -6, 6}]]

enter image description here

RunnyKine
  • 33,088
  • 3
  • 109
  • 176
Nabil
  • 513
  • 3
  • 16

3 Answers3

9

You can use ContourShading with Directives to achieve both.

 α = 1; β = 1; tmp = 0.1316; ρ = 0.01; t = -1.5; 

    fe[m_, p_] := 1/2*(t - 1)*p^2 + 1/4*p^4 + (1/2*α^2*β*m^2*(t - tmp)) + 
      1/4 α^2*(β)*(m^4) + 1/2*(ρ*(p^2)*(m^2)) ; 

 SliceContourPlot3D[-z, z == fe[m, p], {m, -3, 3}, {p, -3, 3}, {z, -6, 6}, 
          ContourShading -> Directive[Red, Opacity[0.5]]]

Mathematica graphics

RunnyKine
  • 33,088
  • 3
  • 109
  • 176
9

You can add transparency to a color function. No need to make the whole plot to have one color.

Show[SliceContourPlot3D[-z, 
  z == fe[m, p], {m, -3, 3}, {p, -3, 3}, {z, -6, 6}, 
  ColorFunction -> 
   Function[{z}, Opacity[0.4, #] &@ColorData["TemperatureMap"][z]], 
  ContourStyle -> None]]

enter image description here

BlacKow
  • 6,428
  • 18
  • 32
  • +1. I like your ColorFunction approach. – RunnyKine Apr 18 '16 at 20:58
  • @RunnyKine I can't figure out how to obtain the default ColorFunction so you can apply Opacity to it. Any ideas? – BlacKow Apr 18 '16 at 21:04
  • 1
    The following should give you the ColorFunction: ff = Trace[ SliceContourPlot3D[Exp[-(x^2 + y^2 + z^2)], x^3 + y^2 - z^2 == 0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}], _Blend &] // Flatten // ReleaseHold. Then: cf = Function[{x}, Blend[x, #] &]@ff – RunnyKine Apr 18 '16 at 21:20
  • @RunnyKine it works for this case! I asked a question about general solution. – BlacKow Apr 18 '16 at 22:23
5

Perhaps not entirely what you'd want but for fun sake:

Example:

SliceContourPlot3D[-z, z == fe[m, p], {m, -3, 3}, {p, -3, 3}, {z, -6, 6},ContourShading -> None];

Output:

output example

Reference:

ContourShading

e.doroskevic
  • 5,959
  • 1
  • 13
  • 32