dev2bitmap             package:grDevices             R Documentation

_G_r_a_p_h_i_c_s _D_e_v_i_c_e _f_o_r _B_i_t_m_a_p _F_i_l_e_s _v_i_a _G_h_o_s_t_S_c_r_i_p_t

_D_e_s_c_r_i_p_t_i_o_n:

     'bitmap' generates a graphics file. 'dev2bitmap' copies the
     current graphics device to a file in a graphics format.

_U_s_a_g_e:

     bitmap(file, type = "png16m", height = 7, width = 7, res = 72,
            units = "in", pointsize, taa = NA, gaa = NA, ...)

     dev2bitmap(file, type = "png16m", height = 7, width = 7, res = 72,
                units = "in", pointsize, ...,
                method = c("postscript", "pdf"), taa = NA, gaa = NA)

_A_r_g_u_m_e_n_t_s:

    file: The output file name, with an appropriate extension.

    type: The type of bitmap. the default is '"png256"'.

width, height: Dimensions of the display region.

     res: Resolution, in dots per inch.

   units: The units in which 'height' and 'width' are given.  Can be
          'in' (inches), 'px' (pixels), 'cm' or 'mm'.

pointsize: The pointsize to be used for text: defaults to something
          reasonable given the width and height

     ...: Other parameters passed to 'postscript' or 'pdf'.

  method: Should the plot be done by 'postscript' or 'pdf'?

taa, gaa: Number of bits of antialiasing for text and for graphics
          respectively.  Usually 4 (for best effect) or 2.  Not
          supported on all types.

_D_e_t_a_i_l_s:

     'dev2bitmap' works by copying the current device to a 'postscript'
     or 'pdf' device, and post-processing the output file using
     'ghostscript'. 'bitmap' works in the same way using a 'postscript'
     device and post-processing the output as 'printing'.

     You will need 'ghostscript': the full path to the executable can
     be set by the environment variable 'R_GSCMD'. (If this is unset
     the command '"gs"' is used, which will work if it is in your
     path.)

     The types available will depend on the version of 'ghostscript',
     but are likely to include '"pcxmono"', '"pcxgray"', '"pcx16"',
     '"pcx256"', '"pcx24b"', '"pcxcmyk"', '"pbm"', '"pbmraw"', '"pgm"',
     '"pgmraw"', '"pgnm"', '"pgnmraw"', '"pnm"', '"pnmraw"', '"ppm"',
     '"ppmraw"', '"pkm"', '"pkmraw"', '"tiffcrle"', '"tiffg3"',
     '"tiffg32d"', '"tiffg4"', '"tifflzw"', '"tiffpack"', '"tiff12nc"',
     '"tiff24nc"', '"psmono"', '"psgray"', '"psrgb"', '"bit"',
     '"bitrgb"', '"bitcmyk"', '"pngmono"', '"pnggray"', '"pngalpha"',
     '"png16"', '"png256"', '"png16m"', '"png48"', '"jpeg"',
     '"jpeggray"', '"pdfwrite"'.

     The default type, '"png16m"' supports 24-bit colour and
     anti-aliasing.  Versions of R prior to 2.7.0 defaulted to
     '"png256"', which uses a palette of 256 colours and could be a
     more compact representation.  Monochrome graphs can use
     '"pngmono"', or '"pnggray"' if anti-aliasing is desired.

     Note that for a colour TIFF image you probably want '"tiff24nc"',
     which is 8-bit per channel RGB (the most common TIFF format). 
     None of the listed TIFF types support transparency.

     For formats which contain a single image, a file specification
     like 'Rplots%03d.png' can be used: this is interpreted by
     GhostScript.

     For 'dev2bitmap' if just one of 'width' and 'height' is specified,
     the other is chosen to preserve aspect ratio of the device being
     copied.  The main reason to prefer 'method = "pdf"' over the
     default would be to allow semi-transparent colours to be used.

     For graphics parameters such as '"cra"' that need to work in
     pixels, the default resolution of 72dpi is always used.

_V_a_l_u_e:

     None.

_C_o_n_v_e_n_t_i_o_n_s:

     This section describes the implementation of the conventions for
     graphics devices set out in the "R Internals Manual".  These
     devices follow the underlying device, so when viewed at the stated
     'res':


        *  The default device size is 7 inches square.

        *  Font sizes are in big points.

        *  The default font family is (for the standard GhostScript
           setup) URW Nimbus Sans.

        *  Line widths are as a multiple of 1/96 inch, with no minimum. 

        *  Circle of any radius are allowed.

        *  Colours are interpreted by the viewing/printing application.

_S_e_e _A_l_s_o:

     'savePlot', which for 'windows' and 'X11(type = "Cairo")' provides
     a simple way to record a PNG record of the current plot.

     'postscript', 'pdf', 'png' and 'jpeg' and on Windows 'bmp'.

     To display an array of data, see 'image'.

