png                   package:base                   R Documentation

_J_P_E_G _a_n_d _P_N_G _g_r_a_p_h_i_c_s _d_e_v_i_c_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     A graphics device for JPEG or PNG format bitmap files.

_U_s_a_g_e:

     jpeg(filename="Rplot.jpg", width=480, height=480, pointsize=12, quality=75)
     png(filename="Rplot.png", width=480, height=480, pointsize=12)

_A_r_g_u_m_e_n_t_s:

filename: the name of the output file.

   width: the width of the device in pixels.

  height: the height of the device in pixels.

pointsize: the default pointsize of plotted text.

 quality: the `quality' of the JPEG image, as a percentage. Smaller
          values will give more compression but also more degradation
          of the image.

_D_e_t_a_i_l_s:

     Plots in PNG and JPEG format can easily be converted to many other
     bitmap formats, and both can be displayed in most modern web
     browsers. The PNG format is lossless and is best for line diagrams
     and blocks of solid colour. The JPEG format is lossy, but may be
     useful for image plots, for example.

_V_a_l_u_e:

     A plot device is opened: nothing is returned to the R interpreter.

_N_o_t_e:

     These are based on the `X11' device, so the additional arguments
     to that device work, but are rarely appropriate.

_A_u_t_h_o_r(_s):

     Guido Masarotto and Brian Ripley

_S_e_e _A_l_s_o:

     `Devices', `dev.print'

_E_x_a_m_p_l_e_s:

     ## copy current plot to a PNG file
     dev.print(png, file="myplot.png", width=480, height=480)

