[R] Plots without X11 in CentOS

peter dalgaard pdalgd at gmail.com
Fri Apr 24 16:41:19 CEST 2015


Plot directly to the appropriate device, e.g. 

pdf(file="my.pdf")
plot(rnorm(500))
dev.off()

This is often recommendable even if you do have an on-screen graphics device because some subtleties can get lost in translation for one device to another. (The prototypical example is that a legend box is sized to hold the text in the font used on the screen device. Then, saving to PDF causes the box to be scaled and the font to change, but it can happen that the text now overruns the box extents.)

Peter D.

On 24 Apr 2015, at 16:12 , Sudip Chatterjee <sudipanalyst at gmail.com> wrote:

> Hi All,
> 
> I am wondering how to save plots in R at CentOS when X11 is not available,
> any suggestion would be appreciated.
> 
> Warm Regards
> Sudip
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list