zipfR.begin.plot
opens a new plotting window or image file of
the specified dimensions (width
, height
), using the
selected graphics device (device
). Background colour
(bg
) and default point size (pointsize
) are set as
requested. Then, any global graphics parameter settings (defined with
the init.par
option of zipfR.par
) are applied.
See the zipfR.par
manpage for the "factory default"
settings of these options.
zipfR.end.plot
finalizes the current plot. For image file
devices, the device will be closed, writing the generated file to
disk. For screen devices, the plotting window remains visible until a
new plot is started (which will close and re-open the plotting
window).
The main purpose of the zipfR
plotting utilities is to make it
easier to draw plots that are both shown on screen (for interactive
work) and saved to image files in various formats. If an R script
specifies filename
s in all zipfR.begin.plot
commands, a
single global parameter setting at the start of the script is
sufficient to switch from screen graphics to EPS files, or any other
supported file format.
On-screen plotting devices are platform-dependent, and there may be
different devices available depending on which version of R is used.
For this reason, zipfR.begin.plot
no longer allows users to
pick an on-screen device explicitly, but rather opens a default device
with dev.new
. Note that this default device may write
output to a graphics file, but is usually set to a suitable on-screen
device in an interactive R session. In any case, users can change the
default by setting options(device=...)
. For backwards-compatibility,
the device name x11
(and quartz
on macOS is accepted
for the default graphics device.
The png
bitmap device may not be available on all platforms,
and may also require access to an X server. Since the width and
height of a PNG device have to be specified in pixels rather than
inches, zipfR.begin.plot
translates the width
and
height
settings, assuming a resolution of 150 dpi. Use of
the png
device is strongly discouraged. A better way of
producing high-quality bitmaps is to generate EPS image (with the
eps
device) and convert them to PNG or JPEG format with the
external pstoimg
program (part of the latex2html
distribution).
zipfR.pick.device
will issue a warning if multiple flags
matching supported graphics devices are found. However, it is not an
error to find no matching flag, and all unrecognized strings are
silently ignored.