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)
       })    

