sl.plot.3D.init: 3D Polar Plot

View source: R/sl.plot.3D.init.R

sl.plot.3D.initR Documentation

3D Polar Plot

Description

Initialise a spheRlab 3D polar plot. Two panels are drawn next to each other, rotated slightly such that a 3D effect occurs when the panels are overlaid, by aiming with the eyes at a point either before or behind the plane where the figure is displayed.

Usage

sl.plot.3D.init(projection = "polar", width = 30, lonlatrot.left = c(10, 0, 0), lonlatrot.right = c(-10, 0, 0), gap.frac = 0.1, col.background = NULL, precision = 1, device = "pdf", do.init = TRUE, do.init.device = do.init, file.name = paste0("~/sl.plot.3D.",device), mar = rep(0,4))

Arguments

projection

a character specifying the plot projection to be used. At the moment only 'polar' is implemented (the default).

width

a scalar specifying the width of the resulting figure.

lonlatrot.left

a vector of length 3 specifying the longitude and latitude of the projection north pole and the amount of rotation in degrees for the left panel.

lonlatrot.right

a vector of length 3 specifying the longitude and latitude of the projection north pole and the amount of rotation in degrees for the right panel.

gap.frac

a scalar specifying the relative width of the gap between the two panels.

col.background

a background colour. Default is col.background=NULL, meaning that no background is drawn. Note that this parameter determines only the backgound colour of the map(s). To set the background colour of the whole plot, use par(bg=...) before calling sl.plot.3D.init.

precision

a scalar specifying the precision (in degrees) at which the backgound polygon boundary is broken into straight line segments. Used only if col.background != NULL.

device

a character specifying which graphics device to use. Default is device='pdf'. Ignored if do.init.device=FALSE.

do.init

a logical value indicating whether or not an initial call of plot shall be executed. Default is do.init=TRUE.

do.init.device

a logical value indicating whether or not initialise a device as specified by device. Default is do.init.device=do.init. If do.init.device=FALSE but do.init=TRUE, the plot will be initialised in the standard graphical device.

file.name

a character specifying the output file. Only used if do.init.device=TRUE. Default is file.name=paste0('~/sl.plot.3D.',device).

mar

a numerical vector of the form c(bottom, left, top, right) which gives the relative width of margin to be added to the four sides of the plot. This can be used to make space for a colourbar, for example. The default is rep(0,4).

Details

The list returned from this function must be provided to any spheRlab plotting functions called afterwards to fill the plot with data. After all plotting is done, sl.plot.end must be called, again with the list returned from this function provided.

A displacement of the two poles by about 20 degrees (as by default) may be appropriate.

Value

A list that must be provided to any spheRlab plotting functions called afterwards. In fact, the returned list contains two standard spheRlab plot specifics lists as the first two (unnamed) elements for the two panels that will be generated for the 3D plot, plus a third list element ...$projection="3D".

Author(s)

Helge Goessling

See Also

sl.plot.end, sl.plot.init, sl.plot.platon.init

Examples

## To be provided ...

helgegoessling/spheRlab documentation built on April 8, 2024, 8:34 a.m.