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