I'm trying to duplicate what this Mathematica code does in SAGE:

F[z_]=4*Log[z^3]-2*Log[z^3-8]
a=ContourPlot[If[y<Sqrt[3]*x, Im[F[x+I*y]]], {x, 0, 4}, {y, 0, 4},
ContourShading->False, Contours->30]
b=Plot[Sqrt[3]*x, {x, 0, 4}]
Show[a, b]

I originally used this (this doesn't include the sqrt(3)*x line in the
code above):

z = var('z')
f(z) = 4*log(z^3)-2*log(z^3-8)
g = lambda x,y: imag(f(x+y*I))
a = contour_plot(g,(x,0,4),(y,0,4),fill=False,contours=30)

Robert Bradshaw suggested I use:

g = lambda x,y: imag(f(x+y*I)) if y < sqrt(3)*x else float('nan')

It works, but as Robert said, it isn't really pretty. Any suggestions?

Thanks,

Sterling

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to