ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 19 May 2015 12:27:14 -0500In-line graphics for Sage in ipython notebook?http://ask.sagemath.org/question/10988/in-line-graphics-for-sage-in-ipython-notebook/I am running Sage on a local machine (OS X Mavericks) from an ipython notebook. Everything works fine except that I don't have pretty printing or in-line graphics (2D or 3D) -- the graphics launch in Preview.app. Is it possible to obtain either of these features in the ipython notebook interface? Tue, 04 Feb 2014 03:20:55 -0600http://ask.sagemath.org/question/10988/in-line-graphics-for-sage-in-ipython-notebook/Answer by eric_g for <p>I am running Sage on a local machine (OS X Mavericks) from an ipython notebook. Everything works fine except that I don't have pretty printing or in-line graphics (2D or 3D) -- the graphics launch in Preview.app. Is it possible to obtain either of these features in the ipython notebook interface? </p>
http://ask.sagemath.org/question/10988/in-line-graphics-for-sage-in-ipython-notebook/?answer=26883#post-id-26883Hi,
With a recent version of Sage (at least 6.6, but 6.7 (released 2 days ago!) is recommended), 2D and 3D inline plots in the IPython notebook work nicely when the notebook is started by the command
sage -n ipython
Tue, 19 May 2015 11:50:04 -0500http://ask.sagemath.org/question/10988/in-line-graphics-for-sage-in-ipython-notebook/?answer=26883#post-id-26883Comment by jguzman for <p>Hi,</p>
<p>With a recent version of Sage (at least 6.6, but 6.7 (released 2 days ago!) is recommended), 2D and 3D inline plots in the IPython notebook work nicely when the notebook is started by the command</p>
<pre><code>sage -n ipython
</code></pre>
http://ask.sagemath.org/question/10988/in-line-graphics-for-sage-in-ipython-notebook/?comment=26885#post-id-26885Fantastic!!!! tested in Sage 6.7, it works like a charm!Tue, 19 May 2015 12:27:14 -0500http://ask.sagemath.org/question/10988/in-line-graphics-for-sage-in-ipython-notebook/?comment=26885#post-id-26885Answer by jguzman for <p>I am running Sage on a local machine (OS X Mavericks) from an ipython notebook. Everything works fine except that I don't have pretty printing or in-line graphics (2D or 3D) -- the graphics launch in Preview.app. Is it possible to obtain either of these features in the ipython notebook interface? </p>
http://ask.sagemath.org/question/10988/in-line-graphics-for-sage-in-ipython-notebook/?answer=26874#post-id-26874The [link](http://pub.ist.ac.at/~jguzman/doc/programming/Sage/ipython.html) points to my website, which I recently updated. The only way I found at the moment to plot inline was to enter this in the IPython notebook:
%load_ext sage
from IPython.display import display, Image
x = var('x')
plot(sin(x), 0, 2*pi, figsize=4).save('/tmp/foo.png')
display(Image('/tmp/foo.png')
Tue, 19 May 2015 06:53:17 -0500http://ask.sagemath.org/question/10988/in-line-graphics-for-sage-in-ipython-notebook/?answer=26874#post-id-26874Comment by jguzman for <p>The <a href="http://pub.ist.ac.at/~jguzman/doc/programming/Sage/ipython.html">link</a> points to my website, which I recently updated. The only way I found at the moment to plot inline was to enter this in the IPython notebook:</p>
<pre><code> %load_ext sage
from IPython.display import display, Image
x = var('x')
plot(sin(x), 0, 2*pi, figsize=4).save('/tmp/foo.png')
display(Image('/tmp/foo.png')
</code></pre>
http://ask.sagemath.org/question/10988/in-line-graphics-for-sage-in-ipython-notebook/?comment=26875#post-id-26875tested with Sage 6.7Tue, 19 May 2015 06:53:58 -0500http://ask.sagemath.org/question/10988/in-line-graphics-for-sage-in-ipython-notebook/?comment=26875#post-id-26875Answer by ppurka for <p>I am running Sage on a local machine (OS X Mavericks) from an ipython notebook. Everything works fine except that I don't have pretty printing or in-line graphics (2D or 3D) -- the graphics launch in Preview.app. Is it possible to obtain either of these features in the ipython notebook interface? </p>
http://ask.sagemath.org/question/10988/in-line-graphics-for-sage-in-ipython-notebook/?answer=16006#post-id-16006I don't have ipython notebook installed either system wide or in sage. Perhaps the instructions in the following website helps?
http://pub.ist.ac.at/~jguzman/doc/programming/Sage/ipython.htmlTue, 04 Feb 2014 05:13:49 -0600http://ask.sagemath.org/question/10988/in-line-graphics-for-sage-in-ipython-notebook/?answer=16006#post-id-16006Comment by ppurka for <p>I don't have ipython notebook installed either system wide or in sage. Perhaps the instructions in the following website helps?</p>
<p><a href="http://pub.ist.ac.at/~jguzman/doc/programming/Sage/ipython.html">http://pub.ist.ac.at/~jguzman/doc/pro...</a></p>
http://ask.sagemath.org/question/10988/in-line-graphics-for-sage-in-ipython-notebook/?comment=16335#post-id-16335You can post this in sage-support. I don't know of any trivial way to do this.Tue, 04 Feb 2014 12:51:41 -0600http://ask.sagemath.org/question/10988/in-line-graphics-for-sage-in-ipython-notebook/?comment=16335#post-id-16335Comment by Han for <p>I don't have ipython notebook installed either system wide or in sage. Perhaps the instructions in the following website helps?</p>
<p><a href="http://pub.ist.ac.at/~jguzman/doc/programming/Sage/ipython.html">http://pub.ist.ac.at/~jguzman/doc/pro...</a></p>
http://ask.sagemath.org/question/10988/in-line-graphics-for-sage-in-ipython-notebook/?comment=24321#post-id-24321I have the same question here. Hope there is a way to solve it.Sun, 28 Sep 2014 11:02:55 -0500http://ask.sagemath.org/question/10988/in-line-graphics-for-sage-in-ipython-notebook/?comment=24321#post-id-24321Comment by sswatson for <p>I don't have ipython notebook installed either system wide or in sage. Perhaps the instructions in the following website helps?</p>
<p><a href="http://pub.ist.ac.at/~jguzman/doc/programming/Sage/ipython.html">http://pub.ist.ac.at/~jguzman/doc/pro...</a></p>
http://ask.sagemath.org/question/10988/in-line-graphics-for-sage-in-ipython-notebook/?comment=16336#post-id-16336Thanks for the link. I put the suggested lines in my init file, but they only apply to figures generated through matplotlib (not plots generated using the Sage plot command). Tue, 04 Feb 2014 08:58:20 -0600http://ask.sagemath.org/question/10988/in-line-graphics-for-sage-in-ipython-notebook/?comment=16336#post-id-16336