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$
  • $\begingroup$ Look up SliceContourPlot3D[]. $\endgroup$ – J. M. is away Sep 6 '17 at 14:51
  • $\begingroup$ @J.M. this is 3D, I need 2D $\endgroup$ – Foad Sep 6 '17 at 15:00
  • $\begingroup$ ContourPlot[ Evaluate@Table[z - f[x, y]==0, {x, xlevelsList}], {y, ymin, ymax}, {z, zmin, zmax}]? $\endgroup$ – kglr Oct 6 '17 at 16:06
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, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.