Mathematica graphics in a sage notebook - second take
This question was already asked, but the answer doesn't work for me so I was suggested that I ask it again with the specifics of my problem. So here goes.
To quote Simons's answer:
In SAGE_ROOT/devel/sage/sage/interfaces/mathematica.py you find the show() function:
def show(self, filename=None, ImageSize=600):
r"""
Show a mathematica expression or plot in the Sage notebook.
EXAMPLES::
sage: P = mathematica('Plot[Sin[x],{x,-2Pi,4Pi}]') # optional - mathematica
sage: show(P) # optional - mathematica
sage: P.show(ImageSize=800) # optional - mathematica
sage: Q = mathematica('Sin[x Cos[y]]/Sqrt[1-x^2]') # optional - mathematica
sage: show(Q) # optional - mathematica
<html><div class="math">\frac{\sin (x \cos (y))}{\sqrt{1-x^2}}</div></html>
"""
I'm not sure should I use sage input method or mathematica so I'll do both.
sage input method:
For test that MathKernel works:
mathematica('N[Pi,10]')
returns
3.141592654
Now if I try the first example:
P = mathematica('Plot[Sin[x],{x,-2Pi,4Pi}]')
show(P)
I get nothing, it just appears to work (waiting cursor) but no output. By checking the process list on server, MathKernel is shown.
Next I tried mathematica input method:
N[Pi,10]
returns
3.141592654
Test works.
Plot[Sin[x],{x,-2Pi,4Pi}]
returns
-Graphics-
EDIT: Ubuntu Server 10.04 without GUI, Mathematica 8.0, Sage 4.7.1