Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Waiting for a better solution in 3d graphics one can use unicode characters and for example https://www.unicodeit.net

def f(x,y):
    return math.sqrt(x*y)
P = plot3d(f, (0, 1.8), (0, 1.6), color='lightgrey',opacity=0.6)
from sage.plot.plot3d.plot3d import axes
S = P + axes(2.2, color='grey',radius=1)
po2={'fontsize':20,'color':'black'}
p= text3d(r"f(𝛼,φ) = √𝛼⋅√φ", (1,0.5,2.25),**po2)
t=text3d("𝛼",(2.3,0.0,0.0),**po2)       
t+=text3d("φ",(0.0,2.5,0.0),**po2)           
t+=text3d("θ",(0.,0.0,2.3),**po2)
S=(S+t+p).rotateZ(-pi/1.1)   
S.show(frame=False,aspect_ratio=[1,1,0.7])

or

U=lambda x,y: math.sqrt(x*y)
var("x,y,z")
z1, z2 = 0.25, 2
ni = 10
dz = (z2-z1)/ni
def col2(x,y):
    return float(0.5*dz+floor((U(x,y)-z1)/dz)/ni)
p = plot3d(U, (x,0,2), (y,0,2), color=(col2,colormaps.jet), plot_points=200)
p+= arrow3d((0, 0, 0), (2.4, 0, 0), color='red')
p+= arrow3d((0, 0, 0), (0, 2.3, 0), color='red')
p+= arrow3d((0, 0, 0), (0, 0, 3.2), color='red',radius=0.015)
po2={'fontsize':20,'color':'black'}
p+= text3d(r"U(𝛼,φ) = √𝛼⋅√φ", (0,0.5,4),**po2)
t=text3d("𝛼",(2.7,0,0),**po2)       
t+=text3d("φ",(0,2.4,0.0),**po2)            
t+=text3d("θ",(0.,0.0,3.4),**po2)
show((p+t).rotateZ(pi/1.11), aspect_ratio=[1,1,0.45],frame=False)