[IPython-User] RMagic causing X11 png call?

Massimo Di Stefano massimodisasha@gmail....
Thu Sep 6 11:16:54 CDT 2012


Yes You are right!

i have exactly the same behavior (forgot to mention this)

is like RMagic instantiate the graphic environment when it load  RMagic/rpy2 modules

Massimo.



Il giorno Sep 6, 2012, alle ore 11:51 AM, Spencer Ogden ha scritto:

> What is strange is that the command I am running:
> 
> %R b <- c(1,2,3,4)
> 
> Should not produce any graphical output. I cannot run any R code with RMagic.
> 
> Spencer
> 
> 
> 
> On 9/6/2012 11:16 AM, Massimo Di Stefano wrote:
>> Hi Spencer,
>> 
>> i noticed the list with the same problem.
>> on this list, see the topic :
>> 
>>  R magic extension and default R graphic drivers
>> 
>> http://old.nabble.com/R-magic-extension-and-default-R-graphic-drivers-td34376003.html
>> 
>> my understanding is :
>> 
>> as default R use the  png-x11 driver,  in order to produce a png (used by the notebook)
>> we should specify R to use an other Driver ..  "cairo" can be a good option.
>> in R you can specify the driver to be used (instead of the default X11 png) with a syntax like :
>> 
>>> png(file="myplot.png", bg="transparent", type="cairo'")
>> 
>> or typing the instruction :
>> 
>> options(bitmapType="cairo") 
>> 
>> and then you can avoid to specify the "type=cairo"  in the plot instruction.
>> 
>> an other way is  to add inside a .Rprofile file in your home. 
>> a line like :
>> 
>> options(bitmapType="cairo") 
>> 
>> 
>> 
>> Unfortunately the Rmagic extension seems to don't recognize the .Rprofile settings
>> or more probable, in the RMagic src code :
>> 
>> IPython/extensions/rmagic.pyc in R(self, line, cell, local_ns)
>>     513 
>>     514         tmpd = tempfile.mkdtemp()
>> --> 515         self.r('png("%s/Rplots%%03d.png",%s)' % (tmpd, png_args))
>>     516 
>>     517         text_output = ''
>> we should be able to pass the  "type-cairo" as argument to the png() function.
>> 
>> 
>> i'm trying to modify the src code but without success
>> 
>> Massimo.
>> 
>> 
>> 
>> 
>> 
>> Il giorno Sep 6, 2012, alle ore 9:11 AM, Spencer Ogden ha scritto:
>> 
>>> I am running iPython remotely and I don't have X11 setup. For some 
>>> reason, RMagic, even with simple code, is trying to present a PNG 
>>> through X11, and failing since there is no X11.
>>> 
>>> I tried %gui to turn of any GUI integration. When I enter "%R b <- 
>>> c(1,2,3,4)" I get a RRuntimeError:
>>> 
>>> RRuntimeError: Error in png("/tmp/tmpwGLwWm/Rplots%03d.png", ) : X11 is 
>>> not available
>>> 
>>> Why would RMagic be trying to produce a png?
>>> 
>>> I tried this in the web notebook as well and got the same error.
>>> 
>>> Thanks,
>>> 
>>> Spencer
>>> _______________________________________________
>>> IPython-User mailing list
>>> IPython-User@scipy.org
>>> http://mail.scipy.org/mailman/listinfo/ipython-user
>> 
> 
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20120906/01c44ea9/attachment-0001.html 


More information about the IPython-User mailing list