Latex in Plot3d
var('x,y,z') U(x,y)=x^.5*y^.5 levels=[0.25,.5,0.75,1,1.25,1.5,1.75,2] epsilon=0.01 p=plot3d(U(x,y),(x,0,2),(y,0,2),color='lightgreen',opacity=0.7,frame=False) for h in levels: p+=implicit_plot3d(U(x,y)==h,(x,0,2),(y,0,2),(z,h,h+epsilon),color='red') p+=implicit_plot3d(U(x,y)==h,(x,0,2),(y,0,2),(z,0,0.01),color='red')
from sage.manifolds.utilities import set_axes_labels
p+= arrow3d((0, 0, 0), (2.2, 0, 0), color='green')
p+= arrow3d((0, 0, 0), (0, 2.2, 0), color='green')
p+= arrow3d((0, 0, 0), (0, 0, 2.2), color='green')
p+= text3d(r"U(x,y) = x^.5 y^.5", (1, 1, 2.5), color=(0.5, 0, 0))
p+= set_axes_labels(p, r"x",r"y",r"z", color='lightgreen', fontweight='bold')
show(p,viewer='threejs',frame=False)
This would be nice if only the text and label have been implemented in 3D. As I could see the track has been open in 2020. Is it implemented now (https://github.com/sagemath/sage/issues/30226
) ?
This would be nice oif your example cared to define
f
... or replace it by "U".As far as as understand it, your "question" is not a question but a wish. It would be better addressed at sage-devel or sage-support...
FWIW :
using floating-point exponents is usually questionable ; see this recent thread.
unicode_art
may (feebly) help (butsqrt(x*y)
hits a snage, whose orkaround is left to the reader as an exercise).HTH,
I have corrected the
f
. I ask my question here because I have read to ticket from 2020 ans in which a solution seems have been presented. So I was thinking that there was an error.