[sage-support] Re: Plots using R in sage notebook appear later

2011-05-24 Thread giovanni.marche...@ds.unifi.it
Thank you Joal, I tried and that works perfectly. The trick is to start the device and close it at each picture. It's a sensible way to work. Giovanni On May 24, 11:00 am, ancienthart wrote: > Can you try the following for us please? > > png() > hist(x) > dev.off() > > and > > png() > plot(x,y)

[sage-support] Plots using R in sage notebook appear later

2011-05-24 Thread giovanni.marche...@ds.unifi.it
I'm using sage for preparing a notebook with some R computations and plots. I set the language of the worksheet to R. I noticed that plots appear later in the worksheet after the commands are issued and then they may overlap. Example: sage: x = rnorm(10) sage: x [1] -2.92886581 -2.21814906 -1.06

[sage-support] Re: correlation coefficient

2009-07-21 Thread giovanni.marche...@ds.unifi.it
I read in the listing of the function warnings.warn("""\ scipy.stats.corrcoef is deprecated; please update your code to use numpy.corrcoef. Please note that: - numpy.corrcoef rowvar argument defaults to true, not false - numpy.corrcoef bias argument defaults to false, not true """, De

[sage-support] Re: numpy.random

2009-07-02 Thread giovanni.marche...@ds.unifi.it
Thank you so much Ahmed! Your answer was really clear and the solution (for this and other cases) works perfectly. It appears that is crucial to understand how conversions work in Sage. -- Giovanni --~--~-~--~~~---~--~~ To post to this group, send email to sage

[sage-support] numpy.random

2009-06-26 Thread giovanni.marche...@ds.unifi.it
I would like to sample from a multinomial distribution. What's wrong in the following statements in sage 4.0.1? >>> import numpy.random >>> numpy.random.multinomial(10, [.5,.5], size=20) Thank you -- Giovanni Traceback (click to the left for traceback) ... TypeError: unsupported operand paren

[sage-support] Re: Sage notebook and R

2009-04-16 Thread giovanni.marche...@ds.unifi.it
Dear William thank you very much indeed! Great work of yours, Best -- Giovanni On Apr 15, 8:24 pm, William Stein wrote: > On Wed, Apr 15, 2009 at 11:09 AM, giovanni.marche...@ds.unifi.it > > > > wrote: > > > Dynamic Sage notebooks are really amazing. > > &g

[sage-support] Sage notebook and R

2009-04-15 Thread giovanni.marche...@ds.unifi.it
Dynamic Sage notebooks are really amazing. I'm also an R user and I would like very much to use sage to create notebooks with statistical examples in R . Is this possible? By the way , I thought it was allowed to execute R code within an R notebook. However I tried to change the interpreter to

[sage-support] Sage 3.4 and Ubuntu 8.04

2009-03-14 Thread giovanni.marche...@ds.unifi.it
I have Linux Ubuntu 8.04. 32 bit I downloaded Sage 3.4 sage-3.4-linux-Ubuntu_8.10-i686-Linux.tar.gz Sage starts correctly but after notebook() I get an error as follows. Any suggestion ? Thank you Giovanni . exceptions.ImportError: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.8' not fo

[sage-support] Labels for vertices of a graph

2008-12-30 Thread giovanni.marche...@ds.unifi.it
Is there a simple way to define a method that adds labels to the vertices of a graph or digraph? I would like to have something like G.show(labels = ['a', 'b', 'c']) when G is a graph with vertices [0,1,2]. Apparently, this is possible for graphs defined as dictionaries, but not for graphs de

[sage-support] Re: Change to a local variable affects the variable outside the program

2008-12-14 Thread giovanni.marche...@ds.unifi.it
Thank you Lars, I had the feeling that this behavior should be something related to Python, but I was impressed by the inconsistency, because in my first example everything worked as (I) intended. So, if this is a feature of Python I have to study it carefully ! Best regards Giovanni On Dec

[sage-support] Change to a local variable affects the variable outside the program

2008-12-14 Thread giovanni.marche...@ds.unifi.it
The following behavior is very confusing to me. I define a program def test(a): b=a b = a^2 return b Then if I assign x = 2 and then execute test(x) 4 I get x squared and x unchanged: x 2 However suppose now that I want the same on a single element of a matrix and define