According to my understanding, this transformation from a surface in $\mathbb{R}^3$ to contour lines in $\mathbb{R}^3$ to a contour plot in $\mathbb{R}^2$ was made in Grapher, a program exclusive to Apple. Is there a way to view this type of transformation for a desired multivariable function in MATLAB, Python, or some free tool online or compatible with Windows? Is there also a way to view the inverse transformation from a contour plot in $\mathbb{R}^2$ to contour lines in $\mathbb{R}^3$ to a surface in $\mathbb{R}^3$ for such a user supplied function?

  • 1
    $\begingroup$ Yes, you can make such a plot in Matlab using surf and contour3, and similarly in Python with Matplotlib's mplot3d toolkit. // If you can replicate the original animation, can't you also visualize the inverse transformation just by playing the animation backwards? $\endgroup$ – user856 Jan 15 at 19:18
  • $\begingroup$ @Rahul: I think the OP's question assumed you are given only the projected contour plot and need to infer the three-dimensional surface.... no "playing a projection backward." $\endgroup$ – David G. Stork Jan 15 at 19:25
  • $\begingroup$ @David: Well at the end of the sentence they say "for such a user supplied function". So I assumed one has the function itself and not merely a finite number of its contours. $\endgroup$ – user856 Jan 15 at 20:47
  • $\begingroup$ @Rahul I meant that either the user can supply the algebraic function for the surface and the program transforms the surface ultimately into a contour plot, or the user can supply the algebraic function for the contour plot and the program transforms the contour plot ultimately into a surface. $\endgroup$ – user10478 Jan 16 at 16:46
  • $\begingroup$ What does that mean, "the algebraic function for the contour plot"? Don't both plots visualize the same function $\mathbb R^2\to\mathbb R$? $\endgroup$ – user856 Jan 18 at 13:50

enter image description here

In Mathematica (which certainly has Windows-compatible versions):

surface = 
 Plot3D[2.5 + Sin[x^2 y], 
 {x, -2, 2}, {y, -2, 2},
 MeshFunctions -> {#3 &},
 Mesh -> 10,
 MeshStyle -> Directive[Blue, Thickness[0.009]],
 PlotStyle -> Opacity[0.7]];

slice = 
 SliceContourPlot3D[2.5+Sin[x^2 y], 
 {"ZStackedPlanes", 1},
 {x, -2, 2}, {y, -2, 2}, {z, -2, 2},
 ContourStyle -> Directive[Blue, Thickness[0.009]]];


I think you may want to get access to more powerful tools than freeware.

The only way you can go from a contour plot up to a three-dimensional plot is to first infer the function.

| cite | improve this answer | |

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.