Ask Your Question
0

open a plot window from sage-console

asked 2013-06-21 11:22:45 +0100

lehalle gravatar image

updated 2013-06-21 11:27:37 +0100

I have sage notebook working perfectly on my Mac (including plots of course). now I would like to use the sage-shell too. I use the -ipython -pylab options but when I try to draw anything, using for instance:

x=randn(1000); hist(x)

or

f = plt.figure()
plt.plot(range(10),range(10))
plt.show()

nothing happend. Nevetheless if I ask for plt.savefig('blahblah.png') I have the image on my disk...

what did I messed?

very strange...

sage: f1 = lambda x:1
sage: f2 = lambda x:1-x
sage: f3 = lambda x:exp(x)
sage: f4 = lambda x:sin(2*x)
sage: f = Piecewise([[(0,1),f1],[(1,2),f2],[(2,3),f3],[(3,10),f4]])
sage: f.plot()

with the -pylab option alone works, it seems that -ipython is to blame; any idea?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-06-21 11:45:56 +0100

kcrisman gravatar image

You probably will have to set SAGE_MATPLOTLIB_GUI and rebuild matplotlib (probably sage -f matplotlib). See the installation guide.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2013-06-21 11:22:45 +0100

Seen: 817 times

Last updated: Jun 21 '13