The R Project SVN R

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
27442 ripley 1
\name{dev2bitmap}
2
\alias{dev2bitmap}
3
\alias{bitmap}
4
\title{Graphics Device for Bitmap Files via GhostScript}
5
\usage{
6
bitmap(file, type = "png256", height = 6, width = 6, res = 72,
7
       pointsize, \dots)
8
dev2bitmap(file, type = "png256", height = 6, width = 6, res = 72,
9
           pointsize, \dots)
10
}
11
\arguments{
12
  \item{file}{The output file name, with an appropriate extension.}
13
  \item{type}{The type of bitmap. the default is \code{"png256"}.}
14
  \item{height}{The plot height, in inches.}
15
  \item{width}{The plot width, in inches.}
16
  \item{res}{Resolution, in dots per inch.}
17
  \item{pointsize}{The pointsize to be used for text: defaults to
18
    something reasonable given the width and height}
19
  \item{\dots}{Other parameters passed to \code{\link{postscript}}.}
20
}
21
\description{
22
  \code{bitmap} generates a graphics file.
23
  \code{dev2bitmap} copies the current graphics device to a file in a
24
  graphics format.
25
}
26
\details{
27
  \code{dev2bitmap} works by copying the current device to a
28
  \code{\link{postscript}} device, and post-processing the output file
29
  using \code{ghostscript}.  \code{bitmap} works in the same way using a
30
  \code{postscript} device and postprocessing the output as
31
  \dQuote{printing}.
32
 
33
  You will need a version of \code{ghostscript} (5.10 and
34
  later have been tested): the full path to the executable can be set by
35
  the environment variable \env{R\_GSCMD}.
36
 
37
  The types available will depend on the version of \code{ghostscript},
38
  but are likely to include
39
  \code{"pcxmono"}, \code{"pcxgray"}, \code{"pcx16"}, \code{"pcx256"},
40
  \code{"pcx24b"}, \code{"pcxcmyk"}, \code{"pbm"}, \code{"pbmraw"},
41
  \code{"pgm"}, \code{"pgmraw"}, \code{"pgnm"}, \code{"pgnmraw"},
42
  \code{"pnm"}, \code{"pnmraw"}, \code{"ppm"}, \code{"ppmraw"},
43
  \code{"pkm"}, \code{"pkmraw"}, \code{"tiffcrle"}, \code{"tiffg3"},
44
  \code{"tiffg32d"}, \code{"tiffg4"}, \code{"tifflzw"},
45
  \code{"tiffpack"}, \code{"tiff12nc"}, \code{"tiff24nc"},
46
  \code{"psmono"}, \code{"psgray"}, \code{"psrgb"}, \code{"bit"},
47
  \code{"bitrgb"}, \code{"bitcmyk"}, \code{"pngmono"}, \code{"pnggray"},
48
  \code{"png16"}, \code{"png256"}, \code{"png16m"}, \code{"jpeg"},
49
  \code{"jpeggray"}, \code{"pdfwrite"}.
50
 
51
  Note: despite the name of the functions they can produce PDF \emph{via}
52
  \code{type = "pdfwrite"}, and the PDF produced is not bitmapped.
53
 
54
  For formats which contain a single image, a file specification like
27625 ripley 55
  \code{Rplots\%03d.png} can be used: this is interpreted by GhostScript.
27442 ripley 56
 
57
  For \code{dev2bitmap} if just one of \code{width} and \code{height} is
58
  specified, the other is chosen to preserve aspect ratio of the
59
  device being copied.
60
}
61
\value{
62
  None.
63
}
64
 
65
#ifdef windows
66
\note{
67
  Use of \code{bitmap} will leave a temporary file (with file name
68
  starting \code{Rbit}).  Use of the \code{\link{pdf}}, \code{\link{bmp}},
69
  \code{\link{png}} and \code{\link{jpeg}} devices is preferable to
70
  using these functions.
71
}
72
#endif
73
 
74
\seealso{
75
  \code{\link{postscript}}, \code{\link{png}} and
76
  \code{\link{jpeg}} and on Windows \code{bmp}.
77
 
78
  \code{\link{pdf}} generate PDF directly.
79
 
80
  To display an array of data, see \code{\link{image}}.
81
}
82
 
83
\keyword{utilities}