7

I did a fresh install of ARCH linux and so of R version 2.15.1. But after plotting anything with the plot command, the plot window is always empty (nothing shown). Could there be an issue with drivers or something else. I have tried graphics.off() function but to no avail.

Question edited:

The plot however is visible after resizing the plot window.

x<-c(1, 2, 3, 4, 5)
y<-c(0.1, 0.3, 0.7, 1.11, 1.3) 
plot(x, y) 

> sessionInfo() 
R version 2.15.1 (2012-06-22) 
Platform: x86_64-unknown-linux-gnu (64-bit) 
locale: 
[1] C 

attached base packages: 
[1] stats graphics grDevices utils datasets methods base

Question edited:

Setting X11.options(type="nbcairo") works fine.

Shahzad
  • 1,999
  • 6
  • 35
  • 44

1 Answers1

3

Sometimes you need to execute an initial plot.new() or dev.new() to initialize the graphics device. That is supposed to be happening with plot.default() which is the function that would have been called when you gave plot two vectors.

There are options that can affect the graphics device call. Use names(options()) to see the vector of names of the options list. My system is set up so options()$device sets up the quartz device defaults properly. This is an option that is defined when the grDevices package is loaded. See:

?options   # in the grDevices section.

Using ARCH-Linux means you are going down a "less traveled path". There are many more experienced users of Debian (and Debian derived variants like Ubuntu) and RH Linuxen installations. I did find two postings to r-devel from persons using ARCH Linux, so that doesn't suggest widespread knowledge. You might be better off posting to the r-devel mailing list, now that you have behavior that shows there is interactive graphics driver capability, but just a glitch in the initial 'draw' functionality.

IRTFM
  • 258,963
  • 21
  • 364
  • 487
  • Thanks for the answer. How exactly I can determine the current setting of the device. options("device") returns a function instead of some name. – Shahzad Nov 05 '12 at 16:49
  • It is supposed to be able to return a function when accessed by name. At the top of the output you should have seen "$device". If you type options()$device you see what is returned when invoked, but without its list name. (In R lists can hold functions as components.) – IRTFM Nov 05 '12 at 16:53