The R Project SVN R

Rev

Rev 70779 | Rev 85254 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 70779 Rev 75103
Line 1... Line 1...
1
% File src/library/grDevices/man/Devices.Rd
1
% File src/library/grDevices/man/Devices.Rd
2
% Part of the R package, https://www.R-project.org
2
% Part of the R package, https://www.R-project.org
3
% Copyright 1995-2013 R Core Team
3
% Copyright 1995-2018 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{Devices}
6
\name{Devices}
7
\title{List of Graphical Devices}
7
\title{List of Graphical Devices}
8
\alias{Devices}
8
\alias{Devices}
9
\alias{device}
9
\alias{device}
10
\description{The following graphics devices are currently available:
10
\description{The following graphics devices are currently available:
11
  \itemize{
11
  \describe{
12
#ifdef windows
-
 
13
    \item \code{\link{windows}} The graphics device for Windows (on screen,
12
    \item{\code{\link{windows}}:}{On Windows only, the graphics device for
14
    to printer and to Windows metafile).
13
      Windows (on screen, to printer and to Windows metafile).}
15
#endif
-
 
16
    \item \code{\link{pdf}} Write PDF graphics commands to a file
14
    \item{\code{\link{pdf}}:}{Write PDF graphics commands to a file}
17
    \item \code{\link{postscript}} Writes PostScript graphics commands to
15
    \item{\code{\link{postscript}}:}{Writes PostScript graphics commands to
18
    a file
16
      a file}
19
    \item \code{\link{xfig}} Device for XFIG graphics file format
17
    \item{\code{\link{xfig}}:}{Device for XFIG graphics file format}
20
    \item \code{\link{bitmap}} bitmap pseudo-device via
18
    \item{\code{\link{bitmap}}:}{bitmap pseudo-device via
21
    \code{Ghostscript} (if available).
19
      \code{Ghostscript} (if available).}
22
    \item \code{\link{pictex}} Writes TeX/PicTeX graphics commands to a
20
    \item{\code{\link{pictex}}:}{Writes TeX/PicTeX graphics commands to a
23
    file (of historical interest only)
21
      file (of historical interest only)
-
 
22
    }
24
  }
23
  }
25
  The following devices will be functional if \R was compiled to use
24
  The following devices will be functional if \R was compiled to use
26
  them (they exist but will return with a warning on other systems):
25
  them (they exist but will return with a warning on other systems):
27
  \itemize{
26
  \describe{
28
#ifdef unix
-
 
29
    \item \code{\link{X11}} The graphics device for the X11 windowing system
-
 
30
#endif
-
 
31
    \item \code{\link{cairo_pdf}}, \code{cairo_ps} PDF and PostScript
27
    \item{\code{\link{cairo_pdf}}, \code{cairo_ps}:}{PDF and PostScript
32
    devices based on cairo graphics.
28
      devices based on cairo graphics.}
33
    \item \code{\link{svg}} SVG device based on cairo graphics.
29
    \item{\code{\link{svg}}:}{SVG device based on cairo graphics}
34
    \item \code{\link{png}} PNG bitmap device
30
    \item{\code{\link{png}}:}{PNG bitmap device}
35
    \item \code{\link{jpeg}} JPEG bitmap device
31
    \item{\code{\link{jpeg}}:}{JPEG bitmap device}
36
    \item \code{\link{bmp}} BMP bitmap device
32
    \item{\code{\link{bmp}}:}{BMP bitmap device}
37
    \item \code{\link{tiff}} TIFF bitmap device
33
    \item{\code{\link{tiff}}:}{TIFF bitmap device}
-
 
34
  }
-
 
35
  On Unix-alikes (incl. Mac) only:
38
#ifdef unix
36
  \describe{
39
 
-
 
-
 
37
    \item{\code{\link{X11}}:}{The graphics device for the X11 windowing system}
40
    \item \code{\link{quartz}} The graphics device for the macOS
38
    \item{\code{\link{quartz}}:}{The graphics device for the macOS
41
    native Quartz 2d graphics system.  (This is only functional on
39
    native Quartz 2d graphics system.  (This is only functional on
42
    macOS where it can be used from the \code{R.app} GUI and from the
40
    macOS where it can be used from the \code{R.app} GUI and from the
43
    command line: but it will display on the local screen even for a
41
    command line: but it will display on the local screen even for a
44
    remote session.)
42
    remote session.)}
45
#endif
-
 
46
  }
43
  }
47
}
44
}
48
\details{
45
\details{
49
  If no device is open, using a high-level graphics function will cause
46
  If no device is open, calling any high-level graphics function will cause
50
  a device to be opened.  Which device is given by
47
  a device to be opened.  Which device is determined by
51
  \code{\link{options}("device")} which is initially set as the most
48
  \code{\link{options}("device")} which is initially set as the most
52
  appropriate for each platform: a screen device for most interactive use and
49
  appropriate for each platform: a screen device for most interactive use and
53
  \code{\link{pdf}} (or the setting of \env{R_DEFAULT_DEVICE})
50
  \code{\link{pdf}} (or the setting of \env{R_DEFAULT_DEVICE})
54
  otherwise.  The exception is interactive use under Unix if no screen
51
  otherwise.  The exception is interactive use under Unix if no screen
55
  device is known to be available, when \code{pdf()} is used.
52
  device is known to be available, when \code{pdf()} is used.
56
 
53
 
57
  It is possible for an \R package to provide further graphics devices
54
  It is possible for an \R package (or an \R front-end such as RStudio)
-
 
55
  to provide further graphics devices
58
  and several packages on CRAN do so.  These include other devices outputting
56
  and several packages on CRAN do so.  These include other devices outputting
59
  SVG and PGF/TiKZ (TeX-based graphics, see \url{http://pgf.sourceforge.net/}).
57
  SVG and PGF/TiKZ (TeX-based graphics, see \url{http://pgf.sourceforge.net/}).
60
}
58
}
61
\seealso{
59
\seealso{
62
  The individual help files for further information on any of the
60
  The individual help files for further information on any of the
63
  devices listed here;
61
  devices listed here;
64
#ifdef windows
62
  \describe{
65
  \code{\link{windows.options}},
63
    \item{on Windows:}{\code{\link{windows.options}},}
66
#endif
-
 
67
#ifdef unix
-
 
68
  \code{\link{X11}.options}, \code{\link{quartz.options}},
64
    \item{on a Unix-alike:}{\code{\link{X11}.options}, \code{\link{quartz.options}},}
69
#endif
65
  }
70
  \code{\link{ps.options}} and \code{\link{pdf.options}} for how to
66
  \code{\link{ps.options}} and \code{\link{pdf.options}} for how to
71
  customize devices.
67
  customize devices.
72
 
68
 
73
  \code{\link{dev.interactive}},
69
  \code{\link{dev.interactive}},
74
  \code{\link{dev.cur}}, \code{\link{dev.print}},
70
  \code{\link{dev.cur}}, \code{\link{dev.print}},
75
  \code{\link{graphics.off}}, \code{\link{image}},
71
  \code{\link{graphics.off}}, \code{\link{image}},
76
  \code{\link{dev2bitmap}}.
72
  \code{\link{dev2bitmap}}.
77
#ifdef unix
-
 
78
 
73
 
-
 
74
  On Unix-alikes only:\cr
79
  \code{\link{capabilities}} to see if \code{\link{X11}},
75
  \code{\link{capabilities}} to see if \code{\link{X11}},
80
  \code{\link{jpeg}} \code{\link{png}}, \code{\link{tiff}},
76
  \code{\link{jpeg}}, \code{\link{png}}, \code{\link{tiff}},
81
  \code{\link{quartz}} and the cairo-based devices are available.
77
  \code{\link{quartz}} and the cairo-based devices are available.
82
#endif
78
 
83
}
79
}
84
\examples{\dontrun{
80
\examples{\dontrun{
85
## open the default screen device on this platform if no device is
81
## open the default screen device on this platform if no device is
86
## open
82
## open
87
if(dev.cur() == 1) dev.new()
83
if(dev.cur() == 1) dev.new()