If I have a function, f[a, b, c, d], with a, b, c and d varying between 0 and 1 continuously. What would be the best way to explore this function visually with Mathematica? Is evaluating multiple Plot3D expressions with two of the four arguments held constant my only option?


3 Answers 3


For example:

 ContourPlot3D[Norm[{x, y, z}]^ (3 + w), 
               {x, 0, 1}, {y, 0, 1}, {z, 0, 1}, 
               ContourStyle -> (Directive[Opacity[.3, #]] & /@ {Red, Green, Cyan}),
               Contours -> {1, 2, 3}, MeshStyle -> None], 
{w, 0, 1}]

Mathematica graphics

  • $\begingroup$ Nice!!! Further examples plus mathematical proofs can be found in the last 3 chapters of link $\endgroup$
    – eldo
    Commented May 28, 2014 at 18:19
  • $\begingroup$ I'm having difficulties interpreting the contour surfaces in this plot. What do they represent exactly? How can I get a feeling of how my function behaves from the contour surfaces? $\endgroup$
    – Sulli
    Commented Jun 2, 2014 at 14:34
  • $\begingroup$ @su1 "get a feeling" is quite vague :) What exactly do you want to explore? $\endgroup$ Commented Jun 2, 2014 at 14:45
  • $\begingroup$ for example understand from the contour surfaces how my output varies when x increases, knowing all other inputs are fixed. Basically I don't really know how to read a ContourPlot3D. It's easier to read it when it's in the form ContourPlot3D[f==g, ...] but when in the form of ContourPlot3D[f, ...] I don't know what the plot represents $\endgroup$
    – Sulli
    Commented Jun 2, 2014 at 15:16
  • $\begingroup$ @su1 In the form I used the function you've three contours: On the red one the function value is 1, on the green one the value of the function is 2 and in the cyan contour the function evaluates to 3.Is it clear now? $\endgroup$ Commented Jun 2, 2014 at 15:20

Manipulate is a great tool anyway:

  c - Sin[d] - a x^2 - b y^2 + z^2 == x y z, {x, -2, 2}, {y, -2, 
   2}, {z, -2, 2}, Mesh -> None, 
  ColorFunction -> Function[{x, y, z}, Hue[z]], 
  ContourStyle -> Opacity[0.75]], {a, 0, 1}, {b, 0, 1}, {c, 0, 1}, {d,
   0, 1}]

enter image description here

  • 2
    $\begingroup$ If I'm not mistaken, what you're visualizing there is a function of seven arguments. $\endgroup$
    – user484
    Commented May 28, 2014 at 22:58

The method you mention, using the Plot3D expressions, may be implemented pair-wise. That is: represent twin spaces (a,b,f) and (c,d,f), display the fixed values (a1,b1,0) and (c1,d1,0), and the functions f(a,b,c1,d1) and f(a1,b1,c,d), in their corresponding space. Next step, treat the "fixed" values as slider ("pilot") values, and plot the corresponding functions accordingly, letting them evolve "in real time" with their "pilot" values. I've done this with another tool, see Youtube demo at https://www.youtube.com/watch?v=s_h8tlTxRos

  • 1
    $\begingroup$ Please provide actual code in your answer. $\endgroup$
    – bbgodfrey
    Commented Jun 2, 2016 at 22:07

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.