s2png: Start PNG plotting device for spherical objects

View source: R/s2plotting.R

s2pngR Documentation

Start PNG plotting device for spherical objects

Description

This command starts a PNG plotting device and sets appropriate parameters for plotting spherical objects. The device must be closed by the user by calling grDevices::dev.off() or similar when no more graphics will be added.

Usage

s2png(filename, ..., init = FALSE)

Arguments

filename

Name of output file. A temporary file will be generated if it none is given.

...

Arguments passed on to grDevices::png

width

the width of the device.

height

the height of the device.

units

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

pointsize

the default pointsize of plotted text, interpreted as big points (1/72 inch) at res ppi.

bg

the initial background colour: can be overridden by setting par("bg").

res

The nominal resolution in ppi which will be recorded in the bitmap file, if a positive integer. Also used for units other than the default, and to convert points to pixels.

type

character string, one of "Xlib" or "quartz" (some macOS builds) or "cairo". The latter will only be available if the system was compiled with support for cairo – otherwise "Xlib" will be used. The default is set by getOption("bitmapType") – the ‘out of the box’ default is "quartz" or "cairo" where available, otherwise "Xlib".

antialias

for type = "cairo", giving the type of anti-aliasing (if any) to be used for fonts and lines (but not fills). See X11. The default is set by X11.options. Also for type = "quartz", where antialiasing is used unless antialias = "none".

init

Logical to initialize plot with a blank plot with xlim = c(-180,180) and ylim = c(-90,90).

Value

Name of output file.

Examples

img <- s2png()
globe::flatearth()
dev.off()
file.remove(img)


spatstat/spatstat.sphere documentation built on Jan. 27, 2023, 2:59 a.m.