Ask Your Question

In-line graphics for Sage in ipython notebook?

asked 2014-02-04 10:20:55 +0200

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 2014-02-04 12:13:49 +0200

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 15:58:20 +0200 )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 19:51:41 +0200 )edit

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

Han gravatar imageHan ( 2014-09-28 18:02:55 +0200 )edit

answered 2015-05-19 18:50:04 +0200

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 19:27:14 +0200 )edit

answered 2015-05-19 13:53:17 +0200

jguzman gravatar image

updated 2015-05-19 14:04:18 +0200

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 13:53:58 +0200 )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 10:20:55 +0200

Seen: 1,309 times

Last updated: May 19 '15