What is a null graphics device?
In R, a device is the mechanism to produce graphical plots. This can be to screen (e.g. windows ) or to a variety of file types (e.g. png, pdf, tiff, etc).
For an entry point to the help file on devices, see ?Devices. The default devices for the three main operating systems are:
- MS Windows:
windows - Unix:
X11 - OS X:
quartz
The null device means that no device is active. Here is a short code sequence that I used to find out whether I had an open device (dev.cur) and close it (dev.off). When I closed it, the remaining device was the null device.
> dev.cur()
windows
2
> dev.off(2)
null device
1
> dev.cur()
null device
1
The meaning of graphics sybsystem is a bit more unclear. This seems to be the only page in all of help that uses the term. Thus I am guessing that the following are graphics subsystems:
- base graphics
gridgraphics (and anything built on top, includinglatticeandggplot2)rglin packagergl
Related videos on Youtube
isomorphismes
Updated on July 05, 2022Comments
-
isomorphismes 6 monthsI'm reading the
Rhelp page for?devAskNewPage(it was linked from?par...ask). I can't understand whatpar(ask=F)/par(ask=T)does.What do I need to read about to understand this:
If the current device is the null device, this will open a graphics device. ... The precise circumstances when the user will be asked to confirm a new page depend on the graphics subsystem. Obviously this needs to be an interactive session. In addition ‘recording’ needs to be in operation, so only when the display list is enabled (see ‘dev.control’) which it usually is only on a screen device.What are devices, what is the null device, and what is a graphics subsystem? What is 'recording'? Are we talking about the difference between writing to
pngfile and writing to the screen?This feels a bit like learning what standard output and standard input are. Everybody uses the words but it was hard to find the definition (it was also hard to understand it). I googled for "null graphics device" and the top results don't explain to me, as a novice, what I need to know, in order to know where to look.
Just some links to the proper introductory reading would suffice. Thank you.
-
Gavin Simpson about 11 yearsThe graphics subsystem appears to relate to the type of device, not the various graphics packages that allow the user to draw on the device.?dev.controlcontrasts between screen devices and other devices, and the note regarding interactive versus batch operation is perhaps also telling in regard to the intended meaning.