3
$\begingroup$

I have the following equation to generate a contour plot for it:

ContourPlot[{(6 x^2 (-0.00001 + (z)^2))/(6 y^2) == 0.2}, {x, -1, 1}, {y, 0.1, 20}]

It has three variables. The range of the two variables is given above but the variable z has range of {10, 100}. My question is how to introduce the z range here while I want the usual contour plot in two dimensions.

$\endgroup$
1
  • $\begingroup$ Similar to 77039. $\endgroup$
    – Syed
    Commented Dec 1, 2023 at 1:23

2 Answers 2

6
$\begingroup$
$Version

(* "13.3.1 for Mac OS X ARM (64-bit) (July 24, 2023)" *)

Clear["Global`*"]

Either, plot a family of curves,

ContourPlot[
 Evaluate@Table[
   (6 x^2 (-0.00001 + (z)^2))/(6 y^2) == 0.2,
   {z, 10, 100, 15}],
 {x, -1, 1}, {y, 0.1, 20},
 FrameLabel -> (Style[#, 14] & /@ {x, y}),
 PlotLegends -> LineLegend[Range[10, 100, 15],
   LegendLabel -> Style[z, 14]]]

enter image description here

Or Manipulate the z value

Manipulate[
 ContourPlot[
  (6 x^2 (-0.00001 + (z)^2))/(6 y^2) == 0.2,
  {x, -1, 1}, {y, 0.1, 20},
  FrameLabel -> (Style[#, 14] & /@ {x, y})],
 {{z, 10}, 10, 100, 1, Appearance -> "Labeled"},
 SynchronousUpdating -> False,
 TrackedSymbols :> {z}]

enter image description here

$\endgroup$
6
$\begingroup$

Look at a ContourPlot3D from above:

ContourPlot3D[(6 x^2 (-0.00001 + (z)^2))/(6 y^2) == 0.2, 
  {x, -1, 1}, {y, 0.1, 20}, {z, 10, 100},
  ViewPoint -> {0, 0, \[Infinity]}, MeshFunctions -> {#3 &}, Mesh -> 5,
  ContourStyle -> None, Ticks -> {Automatic, Automatic, None}]

enter image description here

$\endgroup$
1
  • $\begingroup$ Further, I want the y-axis to be a log scale. I tried the "Scaling function", but it does not work. Any suggestion this, please? $\endgroup$
    – SciJewel
    Commented Dec 1, 2023 at 8:09

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.