4
$\begingroup$

I use this code to draw the function by ContourPlot3DMultiple times

 {ContourPlot3D[
  x z + y z - x y z == 0, {x, 0, 2}, {y, 0, 2}, {z, 0, 2}], 
 ContourPlot3D[
  x z + y z - x y z == 0.2, {x, 0, 2}, {y, 0, 2}, {z, 0, 2}], 
 ContourPlot3D[
  x z + y z - x y z == 0.4, {x, 0, 2}, {y, 0, 2}, {z, 0, 2}]}

My question is how can I type the function value under each drawingenter image description here

Is there a better way to draw the function in a table shape and to take selected values with the values printed under each drawing c= .

Thanks for the help

$\endgroup$
2
$\begingroup$

Use Labeled.

f = Function[{x, y, z}, x z + y z - x y z]
tmp = StringTemplate["C=``"]
plots = Labeled[
     ContourPlot3D[f[x, y, z] == #, {x, 0, 2}, {y, 0, 2}, {z, 0, 2}],
     tmp[#]] & /@ {0.0, 0.2, 0.4};
Grid[{plots}]

three plot

$\endgroup$
8
$\begingroup$

The functionality you are looking for is Epilog,

c1 = ContourPlot3D[
   x z + y z - x y z == 0, {x, 0, 2}, {y, 0, 2}, {z, 0, 2}, 
   Epilog -> {Text[Style["c=0", 22], Scaled[{0.1, 0.0}]]}];

c2 = ContourPlot3D[
   x z + y z - x y z == 0.2, {x, 0, 2}, {y, 0, 2}, {z, 0, 2}, 
   Epilog -> {Text[Style["c=0.2", 22], Scaled[{0.1, 0.0}]]}];

c3 = ContourPlot3D[
   x z + y z - x y z == 0.4, {x, 0, 2}, {y, 0, 2}, {z, 0, 2}, 
   Epilog -> {Text[Style["c=0.4", 22], Scaled[{0.1, 0.0}]]}];

Grid[{{c1, c2, c3}}]

enter image description here

$\endgroup$
  • $\begingroup$ Possibly, also a Grid with the graphs on one raw and the text on another ? $\endgroup$ – b.gates.you.know.what Jun 11 '17 at 8:25

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.