Ask Your Question
4

In-line graphics for Sage in ipython notebook?

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

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 Preview.app. 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
1

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

ppurka gravatar image

I 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/pro...

edit flag offensive delete link more

Comments

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 -0500 )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 -0500 )edit

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

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

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

jguzman gravatar image

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

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')
 display(Image('/tmp/foo.png')
edit flag offensive delete link more

Comments

tested with Sage 6.7

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

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

eric_g gravatar image

Hi,

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

Comments

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

jguzman gravatar imagejguzman ( 2015-05-19 12:27:14 -0500 )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

Stats

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

Seen: 696 times

Last updated: May 19 '15