Ask Your Question

lehalle's profile - activity

2013-06-21 11:22:45 +0200 asked a question open a plot window from sage-console

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?

2013-02-11 15:34:16 +0200 received badge  Editor (source)
2013-02-11 09:09:27 +0200 asked a question get current username on the server side

I am writing a code that I will put on the server side of SAGE/notebook (i.e. in the SAGE_PATH, not locally in a sheet or attached to a sheet). I want this code to know the name of the user launching it, how can I have it?

following http://https://groups.google.com/foru... , I found an ugly way to do it:

DATA.split('/home/sageservice/nbfiles.sagenb/home/')[0].split('sage_notebook.sagenb/home/')[1].split('/')[0]

tell me if you have better