0
$\begingroup$

I want to plot the level curve of $xyz = 1$;

According to wolfram alpha the plot should look like this;

enter image description here

But instead I end up with;

enter image description here

Here's my Maple code. I'm sure it's because the function is not defined at $x, y = 0$ How do I fix it?

plot3d(1/(x.y), x = -1 .. 1, y = -1 .. 1)
$\endgroup$
0
$\begingroup$

This can be done in a single call to implicitplot3d.

plots:-implicitplot3d(x*y*z=1, x=-1..1, y=-1..1, z=-200..200,
                      grid=[40,40,40], style=surface);

enter image description here

And the particular look & feel can be adjusted as desired, via options. Eg.,

plots:-implicitplot3d(x*y*z=1, x=-1..1, y=-1..1, z=-200..200,
                      grid=[40,40,40], style=surfacecontour,
                      shading=xy, orientation=[-60,60,0]);

enter image description here

I find that manual rotation of a 3D plot having a higher grid resolution performs better with style=surfacecontour than with style=surface.

$\endgroup$
1
$\begingroup$

You can restrict the vertical range by view=-50..50. It also helps to set a grid with even number of data points, so that $(0,0)$ is not one of them. Like this:

plot3d(1/(x*y),x=-1..1,y=-1..1,view=-50..50,grid=[30,30]);  

However, the picture is still isn't as clear, because Maple insists on drawing the vertical asymptotes:

bad

For 2D plots these extra lines can be avoided with discont=true, but for 3D plots the workaround is to plot in each quadrant and combine the plots.

with(plots): 
display(plot3d(1/(x*y),x=0.1..1,y=0.1..1, grid=[20,20]), plot3d(1/(x*y),x=0.1..1,y=-1..-0.1, grid=[20,20]), plot3d(1/(x*y),x=-1..-0.1,y=0.1..1, grid=[20,20]), plot3d(1/(x*y),x=-1..-0.1,y=-1..-0.1, grid=[20,20]));

Ugly code, but better plot.

okay

Or, combining both approaches,

combo

$\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.