Ask Your Question

In-line graphics for Sage in ipython notebook?

asked 2014-02-04 03:20:55 -0600

sswatson gravatar image

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 Is it possible to obtain either of these features in the ipython notebook interface?

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted

answered 2015-05-19 11:50:04 -0600

eric_g gravatar image


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
edit flag offensive delete link more


Fantastic!!!! tested in Sage 6.7, it works like a charm!

jguzman gravatar imagejguzman ( 2015-05-19 12:27:14 -0600 )edit

answered 2014-02-04 05:13:49 -0600

ppurka gravatar image

I don't have ipython notebook installed either system wide or in sage. Perhaps the instructions in the following website helps?

edit flag offensive delete link more


Thanks 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).

sswatson gravatar imagesswatson ( 2014-02-04 08:58:20 -0600 )edit

You can post this in sage-support. I don't know of any trivial way to do this.

ppurka gravatar imageppurka ( 2014-02-04 12:51:41 -0600 )edit

I have the same question here. Hope there is a way to solve it.

Han gravatar imageHan ( 2014-09-28 11:02:55 -0600 )edit

answered 2015-05-19 06:53:17 -0600

jguzman gravatar image

updated 2015-05-19 07:04:18 -0600

The link 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')
edit flag offensive delete link more


tested with Sage 6.7

jguzman gravatar imagejguzman ( 2015-05-19 06:53:58 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-02-04 03:20:55 -0600

Seen: 1,023 times

Last updated: May 19 '15