2
$\begingroup$

Consider a function of $z=f(x,y)$ I want to have a ContourPlot with vertical axis as z and horizontal y and contour of x. How can I do that? I would appreciate if you could explain with a simple example.

P.S. The functional does not necessarily have an analytical inverse.

$\endgroup$
3
  • $\begingroup$ Look up SliceContourPlot3D[]. $\endgroup$ Commented Sep 6, 2017 at 14:51
  • $\begingroup$ @J.M. this is 3D, I need 2D $\endgroup$
    – Foad
    Commented Sep 6, 2017 at 15:00
  • $\begingroup$ ContourPlot[ Evaluate@Table[z - f[x, y]==0, {x, xlevelsList}], {y, ymin, ymax}, {z, zmin, zmax}]? $\endgroup$
    – kglr
    Commented Oct 6, 2017 at 16:06

1 Answer 1

1
$\begingroup$

One approach would be to create a table of values of your function:

tab = Flatten[Table[{y,f[x,y],x},{x,xmin,xmax,xstep},{y,ymin,ymax,ystep}],1]

(With some reasonable values for xmin, xmax, xstep, ymin, ymax, ystep)

You can then create a contour plot with ListContourPlot:

ListContourPlot[tab]

Obviously this requires a bit of manual fiddling to choose parameters which look good, but it should work.

$\endgroup$

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.