savepng             package:geneplotter             R Documentation

_S_a_v_e _t_h_e _c_o_n_t_e_n_t_s _o_f _t_h_e _c_u_r_r_e_n_t _g_r_a_p_h_i_c_s _d_e_v_i_c_e _t_o _a _f_i_l_e

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

     Save the contents of the current graphics device to file

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

       savepdf(fn, dir, width=6, asp=1)
       saveeps(fn, dir, width=6, asp=1) 
       savepng(fn, dir, width=480, asp=1)
       savetiff(fn, dir, density=360, keeppdf=TRUE, ...)

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

      fn: character: name of the output file (without extension).  An
          extension '.pdf', '.eps', '.png', or '.tiff' will be added
          automatically.

     dir: character: directory to which the file should be written.

   width: numeric: width of the image in pixels (png) or inches (pdf,
          eps).

     asp: numeric: aspect ratio; height=width*asp.

 density: pixels per inch (see Details).

 keeppdf: Should the intermediate PDF file (see Details) be kept? If
          'FALSE', it is deleted before the function returns.

     ...: Further arguments that are passed on to 'savepdf' (see
          Details).

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

     The functions are called for their side effect, writing a graphics
     file.

     'savepdf', 'savepng', and 'saveeps' use the devices 'pdf', 'png',
     and 'postscript', respectively.

     There is currently no TIFF device for R, so 'savetiff' works
     differently. It relies on the external tool 'convert' from the
     ImageMagick software package. First, 'savetiff' produces a PDF
     files with 'savepdf', then uses 'system' to invoke 'convert' with
     the parameter 'density'. 'savetiff' does *not* check for the
     existence of  'convert' or the success of the system call, and
     returns silently no matter what.

_V_a_l_u_e:

     Character: name of the file that was written.

_A_u_t_h_o_r(_s):

     Wolfgang Huber <URL: http://www.dkfz.de/abt0840/whuber>

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

     'dev.copy', 'pdf', 'png', 'postscript'

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

       x = seq(0, 20*pi, len=1000)
       plot(x*sin(x), x*cos(x), type="l")

       try({   ## on some machines, some of the devices may not be available
         c(
           savepdf("spiral", dir=tempdir()),
           savepng("spiral", dir=tempdir()),
           saveeps("spiral", dir=tempdir()),
           savetiff("spiral", dir=tempdir())
          )
       })    

