pdf                 package:graphics                 R Documentation

_P_D_F _G_r_a_p_h_i_c_s _D_e_v_i_c_e

_D_e_s_c_r_i_p_t_i_o_n:

     'pdf' starts the graphics device driver for producing PDF
     graphics.

_U_s_a_g_e:

     pdf(file = ifelse(onefile, "Rplots.pdf", "Rplot%03d.pdf"),
         width = 6, height = 6, onefile = TRUE, family = "Helvetica",
         title = "R Graphics Output", encoding, bg, fg, pointsize)

_A_r_g_u_m_e_n_t_s:

    file: a character string giving the name of the file.

width, height: the width and height of the graphics region in inches.

 onefile: logical: if true (the default) allow multiple figures in one
          file.  If false, generate a file name containing the page
          number.

  family: the font family to be used, one of '"AvantGarde"',
          '"Bookman"', '"Courier"', '"Helvetica"',
          '"Helvetica-Narrow"', '"NewCenturySchoolbook"', '"Palatino"'
          or '"Times"'. 

   title: title string to embed in the file.

encoding: the name of an encoding file.  Defaults to '"ISOLatin1.enc"'
          in the 'R_HOME/afm' directory, which is used if the path does
          not contain a path separator.  An extension '".enc"' can be
          omitted.

pointsize: the default point size to be used.

      bg: the default background color to be used.

      fg: the default foreground color to be used.

_D_e_t_a_i_l_s:

     'pdf()' opens the file 'file' and the PDF commands needed to plot
     any graphics requested are sent to that file.

     See 'postscript' for details of encodings, as the internal code is
     shared between the drivers.  The native PDF encoding is given in
     file 'PDFDoc.enc'.

     'pdf' writes uncompressed PDF.  It is primarily intended for
     producing PDF graphics for inclusion in other documents, and
     PDF-includers such as 'pdftex' are usually able to handle
     compression.

     At present the PDF is fairly simple, with each page being
     represented as a single stream.  The R graphics model does not
     distinguish graphics objects at the level of the driver interface.

_N_o_t_e:

     Acrobat Reader does not use the fonts specified but rather
     emulates them from multiple-master fonts.  This can be seen in
     imprecise centering of characters, for example the multiply and
     divide signs in Helvetica.

_S_e_e _A_l_s_o:

     'Devices', 'postscript'

_E_x_a_m_p_l_e_s:

     ## Not run: 
     ## Test function for encodings
     TestChars <- function(encoding="ISOLatin1")
     {
         pdf(encoding=encoding)
         par(pty="s")
         plot(c(0,15), c(0,15), type="n", xlab="", ylab="")
         title(paste("Centred chars in encoding", encoding))
         grid(15, 15, lty=1)
         for(i in c(32:255)) {
             x <- i 
             y <- i 
             points(x, y, pch=i)
         }
         dev.off()
     }
     ## there will be many warnings.
     TestChars("ISOLatin2")
     ## doesn't view properly in US-spec Acrobat 5.05, but gs7.04 works.
     ## Lots of characters are not centred.
     ## End(Not run)

