[IPython-User] RMagic causing X11 png call?
Massimo Di Stefano
Thu Sep 6 10:16:47 CDT 2012
i noticed the list with the same problem.
on this list, see the topic :
R magic extension and default R graphic drivers
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 :
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 :
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)
514 tmpd = tempfile.mkdtemp()
--> 515 self.r('png("%s/Rplots%%03d.png",%s)' % (tmpd, png_args))
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
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.
> IPython-User mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-User