savepng              package:arrayMagic              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 _P_D_F _o_r _P_N_G _f_i_l_e

_D_e_s_c_r_i_p_t_i_o_n:

     Save the contents of the current graphics device to a PDF or PNG
     file

_U_s_a_g_e:

       savepng(fn, dir, width=480, asp=1)
       savepdf(fn, dir, width=6, asp=1)

_A_r_g_u_m_e_n_t_s:

      fn: character: name of the output file (without extension .png or
          .pdf)

     dir: character: directory to which the file should be written. If
          'NULL', use the filename in 'fn' only.

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

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

_D_e_t_a_i_l_s:

_V_a_l_u_e:

     Character: name of the written file.

_A_u_t_h_o_r(_s):

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

_S_e_e _A_l_s_o:

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

_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, png or pdf may not be available
       savepdf("spiral", dir=tempdir())
       ## Not run: 
       savepng("spiral", dir=tempdir())
       
     ## End(Not run)
       })    

