<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi All,<div><br></div><div><br></div><div><br></div><div>i'm trying to run some R code from inside a notebook running on a server that doesn't have X running</div><div>the missing X ... generate an error with the default png driver.</div><div><br></div><div><br></div><div>if i try to run some R code that involve the graphic drivers</div><div>i got an error :</div><div><br></div><div><pre style="margin: 0px; padding: 0px; border: 0px; font-size: 14px; font: inherit; vertical-align: baseline; font-family: monospace, sans-serif; white-space: pre-wrap; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 17px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); "><span class="ansired" style="margin: 0px; padding: 0px; border: 0px; font-size: 14px; font: inherit; vertical-align: baseline; color: rgb(139, 0, 0); ">RRuntimeError</span>: Error in X11(paste("png::", filename, sep = ""), g$width, g$height, pointsize,  : 
  unable to start device PNG</pre><div><br></div></div><div><br></div><div><br></div><div>full error log is here : </div><div><br></div><div><a href="http://epifanio.whoi.edu/data/img/rext_log.txt">http://epifanio.whoi.edu/data/img/rext_log.txt</a></div><div><br></div><div><br></div><div><br></div><div>i guess, the reason of this error is because the server doesn't allow X fwd </div><div>and seems doesn't have X running at all.</div><div><br></div><div>i can reproduce this error (or similar) also from the R console itself :</div><div><br></div><div><div>> png(file="myplot.png", bg="transparent")</div><div>Error in X11(paste("png::", filename, sep = ""), g$width, g$height, pointsize,  : </div><div>  unable to start device PNG</div><div>In addition: Warning message:</div><div>In png(file = "myplot.png", bg = "transparent") :</div><div>  unable to open connection to X11 display ''</div><div>> </div></div><div><br></div><div>it can be avoided if i set the driver to "cairo" :</div><div><br></div><div><div>> options(bitmapType="cairo") </div><div>> png(file="myplot.png", bg="transparent")</div><div>> </div></div><div><br></div><div>The solution in R was to write a file  ".Rprofile" in my home directory, so now i don't need anymore to use options(bitmapType="cairo")  in the R prompt.</div><div><br></div><div>i was hoping that this option was able to fix also the error inside the IPython notebook .. but instead it persist.</div><div><br></div><div><br></div><div><br></div><div>from the error log i can see that in the file :</div><div><br></div><div>IPython/extensions/rmagic.py  </div><div><br></div><div>line 515</div><div><br></div><div>we have :</div><div><br></div><div>self.r('png("%s/Rplots%%03d.png",%s)' % (tmpd, png_args))</div><div><br></div><div>perhaps it is possible to set the driver to be used directly in rmagic code,</div><div>have you any clue on how can i fix this problem?</div><div><br></div><div>thanks a lot!</div><div><br></div><div>Massimo.</div><div><br></div><div>[1]</div><div><br></div><div><br></div><div><br></div><div> </div></body></html>