On Dec 27, 5:39 am, gerhard <[email protected]> wrote:
Hi,
> Thank you Michael,
> that worked - sage 'make test' succeeds
Ok.
> Now I ran into another question I had solved before?
>
> How do I display a png file in the notebook?
> I can't find it in the documentation?!
> Started reading code, but the answer ought to be trivial...
>
> filename = tmp_filename() + '.png'
> r.png(file='"%s"'%filename)
> a=r([1,2,3]);b=r([4,5,6])
> r.plot(a,b)
> r.dev_off()
>
> #now what do I do?
> show??
>
> -gerhard
Check out interfaces/r.py:
def png(self, *args, **kwds):
"""
Creates an R PNG device.
Note that when using the R pexpect interface in the notebook,
you need
to call r.dev_off() in the same cell as you opened the device
on in order
to get the plot to appear.
EXAMPLES:
sage: filename = tmp_filename() + '.png'
sage: r.png(file='"%s"'%filename) #optional requires R
png support
NULL
sage: x = r([1,2,3]) #optional
sage: y = r([4,5,6]) #optional
sage: r.plot(x,y) #optional
NULL
sage: r.dev_off() #optional
null device
1
sage: import os; os.unlink(filename) #optional
The current r.spkg does not build the png interface per default which
is a bug IMHO, but I haven't looked into fixing this yet.
Cheers,
Michael
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---