Learn R Programming

zenplots (version 0.0-4)

plots_loon: Loon-Based Plotting Functions

Description

The 1d and 2d plotting functions based on the R package loon.

Usage

rug_1d_loon(zargs, ...)
points_1d_loon(zargs,
               linkingGroup = NULL, linkingKey = NULL,
               showLabels = FALSE, showScales = FALSE,
               showGuides = FALSE, glyph = "ocircle",
               itemLabel = NULL, showItemLabels = TRUE,
               parent = NULL, ...)
jitter_1d_loon(zargs,
               linkingGroup = NULL, showLabels = FALSE,
               showScales = FALSE, showGuides = FALSE,
               glyph = "ocircle", itemLabel = NULL,
               showItemLabels = TRUE, parent = NULL, ...)
hist_1d_loon(zargs,
             breaks = NULL, color = NULL, fill = NULL,
             showStackedColors = TRUE,
             showBinHandle = FALSE, showLabels = FALSE,
             linkingGroup = NULL, showScales = FALSE,
             showGuides = FALSE, parent = NULL, ...)
density_1d_loon(zargs,
                density.args = list(), method = c("single", "double"),
                lwd = NULL, linewidth = NULL, color = NULL,
                fill = NULL, linecolor = NULL, linkingGroup = NULL,
                showLabels = FALSE, showScales = FALSE,
                showGuides = FALSE, baseplot = NULL, parent = NULL, ...)
boxplot_1d_loon(zargs,
                color = NULL, linecolor = NULL, lwd = 2,
                range = NULL, showLabels = FALSE, showScales = FALSE,
                showGuides = FALSE, linkingGroup = NULL,
                baseplot = NULL, parent, ...)
arrow_1d_loon(zargs,
              loc = c(0.5, 0.5), length = 0.6, angle = NULL,
              linkingGroup = NULL, showLabels = FALSE,
              showScales = FALSE, showGuides = FALSE,
              baseplot = NULL, parent = NULL, ...)
rect_1d_loon(zargs,
             loc.x = NULL, loc.y = NULL, color = NULL,
             fill = NULL, lwd = 1,
             linkingGroup = NULL, showLabels = FALSE,
             showScales = FALSE, showGuides = FALSE,
             baseplot = NULL, parent = NULL, ...)
lines_1d_loon(zargs,
              loc.x = NULL, loc.y = NULL,
              color = NULL, lwd = 1,
              linkingGroup = NULL,
              showLabels = FALSE, showScales = FALSE,
              showGuides = FALSE, baseplot = NULL,
              parent = NULL, ...)
label_1d_loon(zargs,
              loc.x = NULL, loc.y = NULL, label = NULL,
              rot = NULL, size = 8, box = FALSE, color = NULL,
              linkingGroup = NULL, showLabels = FALSE,
              showScales = FALSE, showGuides = FALSE,
              baseplot = NULL, parent = NULL, ...)
layout_1d_loon(zargs, ...)

group_2d_loon(zargs, glabs = NULL, sep = "\n", size = 8, rot = 0, baseplot = NULL, parent = NULL, ...) points_2d_loon(zargs, showLabels = FALSE, showScales = FALSE, showGuides = FALSE, linkingGroup = NULL, linkingKey = NULL, glyph = "ocircle", itemLabel = NULL, showItemLabels = TRUE, parent = NULL, group... = NULL, ...) density_2d_loon(zargs, ngrids = 25, ccol = NULL, color = NULL, clwd = NULL, lwd = NULL, linewidth = 1, showLabels = FALSE, showScales = FALSE, showGuides = FALSE, linkingGroup = NULL, baseplot = NULL, parent = NULL, group... = NULL, ...) axes_2d_loon(zargs, angle = 30, length = 0.05, eps = 0.02, linkingGroup = NULL, color = NULL, showLabels = FALSE, showScales = FALSE, showGuides = FALSE, baseplot = NULL, parent = NULL, group... = NULL, ...) arrow_2d_loon(zargs, loc = rep(0.5, 2), length = 0.2, angle = 30, linkingGroup = NULL, color = NULL, showLabels = FALSE, showScales = FALSE, showGuides = FALSE, baseplot = NULL, parent = NULL, group... = NULL, ...) rect_2d_loon(zargs, loc.x = NULL, loc.y = NULL, color = NULL, fill = NULL, lwd = 1, linkingGroup = NULL, showLabels = FALSE, showScales = FALSE, showGuides = FALSE, baseplot = NULL, parent = NULL, group... = NULL, ...) label_2d_loon(zargs, loc = NULL, label = NULL, rot = 0, size = 8, box = FALSE, color = NULL, linkingGroup = NULL, showLabels = FALSE, showScales = FALSE, showGuides = FALSE, baseplot = NULL, parent = NULL, group... = NULL, ...) layout_2d_loon(zargs, ...)

Arguments

zargs

argument list as passed from zenplot().

linkingGroup

string specifying the initial group of plots to be linked to this plot.

linkingKey

list of IDs to link on.

showLabels

logical determining whether axis labels are displayed.

showScales

logical determining whether scales are displayed.

showGuides

logical determining whether the background guidelines are displayed.

glyph

string determining the glyph type to be displayed for points, default is an open circle: "ocircle".

itemLabel

vector of strings to serve as the item label.

showItemLabels

logical determing whether item labels display on mouse hover.

parent

tk parent for this loon plot widget.

density.args

list() of arguments for density().

method

type of density plot used (single or double; the latter being reflected).

lwd

line width.

linewidth

for

density_1d_loon:

line width of outline for density polygons (highest priority).

density_2d_loon:

line width used when both clwd and lwd are NULL, value of 1 used otherwise.

linecolor

for

density_1d_loon:

colour used for the outline of the density.

boxplot_1d_loon:

colour used for the lines to draw the boxplot.

color

color.

fill

fill color.

baseplot

if non-null the base plot on which the plot should be layered.

range

determines how far the plot whiskers extend out of the box. If range = NULL, this will be automatically determined depending on the sample size.

breaks

break points for the histogram as passed to the underlying hist(). If NULL, the default is to use 20 equi-width bins covering the range of the data.

showStackedColors

logical determining whether to show the individual point colours stacked in the histogram.

showBinHandle

logical to show a handle to adjust bins.

loc

location of the center of the arrow.

length

length of the arrow head.

angle

angle between the shaft and one of the edges of the arrow head.

loc.x, loc.y

x- and y-location.

label

label to be used (with a useful default if NULL).

rot

rotation of the label in degrees.

size

plot size.

box

logical indicating whether a box is drawn around the plot.

glabs

group labels being indexed by the plot variables (thus need to be of length as the number of plot variables); if NULL, they are determined with extract_2d() and the underlying burst().

sep

a separator character for the group labels.

group...

list of arguments passed to group_2d_loon() (or NULL)

ngrids

number of grid points in each dimension (a scalar or an integer vector of length two).

ccol, clwd

colors (ccol) and line widths (clwd) of the contour lines. These can be single values or vectors (which are then recycled).

eps

distance by which the axes are moved away from the plot region.

additional arguments passed to the underlying loon functions.

Value

The path, layout and a loon object (returned invisibly).

Details

These functions based on the R package loon are provided as useful choices for the arguments plot1d and plot2d of zenplot(). See zenplot() how to use them, their source code for how to adjust them, their source code for how to adjust them or how towrite your own plot1d or plot2d. The main idea is that zenplot() passes on the zargs arguments to the plot1d or plot2d functions and the ellipsis argument is used to pass down all other (mostly graphical) parameters (to both plot1d or plot2d).

See Also

zenplot() for how to use these functions.

Examples

Run this code
# NOT RUN {
## Implementation of 1d functions (for plot1d of zenplot())
rug_1d_loon
points_1d_loon
jitter_1d_loon
density_1d_loon
boxplot_1d_loon
hist_1d_loon
arrow_1d_loon
rect_1d_loon
lines_1d_loon
label_1d_loon
layout_1d_loon

## Implementation of 2d functions (for plot2d of zenplot())
group_2d_loon
points_2d_loon
density_2d_loon
axes_2d_loon
arrow_2d_loon
rect_2d_loon
label_2d_loon
layout_2d_loon
# }

Run the code above in your browser using DataLab