Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Color a specific contour line' topicStudent Support Forum > General > Archives > "Color a specific contour line"

Help | Reply To Topic
Author Comment/Response
jparra
10/06/11 04:16am

Hi!

I just plotted one function in 3d as well as his contour-plot.

I would like to know how to select one specific contour line and color it in a different color, so I can follow his changes, when I manipulate my function. It would be just greta if I could mark the contour in the function and in the contour plot.

I paste you the source code, so you know exactly what Im talking about.

Thank you very much!

Manipulate[
With[{p = a*x^2 + x*y + c*y^2},
Labeled[Grid[{{
Plot3D[p, {x, -30, 30}, {y, -30, 30}, MeshFunctions -> {#3 &},
ImageSize -> {Automatic, 240}, Axes -> False],
ContourPlot[p, {x, -30, 30}, {y, -30, 30},
ImageSize -> {Automatic, 240}, Frame -> False]
}}],
Text[Style[TraditionalForm[z == a x^2 + x y + c y^2], 12]], Top]],
{{a, -100,
"\!\(\*SuperscriptBox[\(x\), \(\(2\)\(\\\ \)\)]\)coefficient"}, \
-100, 100, 1, Appearance -> "Labeled"},
{{c, -100,
"\!\(\*SuperscriptBox[\(y\), \(\(2\)\(\\\ \)\)]\)coefficient"}, \
-100, 100, 1, Appearance -> "Labeled"}]

URL: ,
Help | Reply To Topic