Ask Your Question

Revision history [back]

plotting f(x,y)=x/y also plot the plane y=0 instead of being undefined

when i plot f(x,y)=x/y plot3D additionally draws the plane y=0... thus the level curves become crosses instead of lines ... Here is my code :

var('x','y','z')
f(x,y)=x/y
from sage.plot.plot3d.plot3d import axes
P = axes(2, color='black')
P=plot3d(f(x,y),(x,-4,4),(y,-4,4),color='khaki',opacity=0.7)
levels=[-3,-2,-1,0,1,2,3]
epsilon=0.1
for h in levels:
    P+=implicit_plot3d(f(x,y)==h,(x,-4,4),(y,-4,4),(z,h,h+epsilon),color='red')
P.show()

Additionally i would like to specify the range of z (i.e. between -10 and 10), and i cannot find how to do that in the manuel...