# Revision history [back]

Actually, following kcrisman's hint and looking at the sage-notebook thread, it turns out that it's already implemented and so really easy!

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


that does exactly what I wanted.

Actually, following kcrisman's hint and looking at the sage-notebook thread, it turns out that it's already implemented and so really easy!

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


that does exactly what I wanted.

Actually, following kcrisman's hint and looking at the sage-notebook thread, it turns out that it's already implemented and so really easy!

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>
"""


that does exactly what I wanted.

Actually, following kcrisman's hint and looking at the sage-notebook thread, it turns out that it's already implemented and so really easy!

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>
"""


that does exactly what I wanted.