pointsTile: Add plotted points to a tile plot

Description Usage Arguments Details Value pointsTile-specific parameters Generic tile graphical parameters Author(s) See Also

Description

Initializes a trace which plots points to a tile graphic. For more advanced features suitable for detailed scatterplots or summarizing inference from a model, use instead scatter.

Usage

1

Arguments

...

Any number of arguments given below. Must include exactly one horizontal dimension (x or top), and exactly one vertical dimension (y or right). All inputs should be identified by appropriate tags; i.e., use pointsTile(x=myxvar, y=myyvar), not textTile(myxvar,myyvar)

Details

This function does no plotting; instead, it creates a pointsTile object, or trace of plotting data, to be drawn on one or more plots in a tiled arrangement of plots. To complete the drawing include the object as an input to tile. From tile, it is possible to set further options including plot and axis titles, axis ranges and labels, logged axes, and annotations to the plot.

pointsTile simply adds a symbol at a specific location or locations to a tile plot. It serves as the tile equivalent to the base graphics points or grid graphics pointsGrob, and is primarily useful for annotating plots which also use other traces. Note that pointsTile traces must be created in advance and included in the call to tile, rather than added afterward.

To plot symbols to a location outside the plotting area, users might try combining clip="off", with coordinates placing the symbols in the desired spot.

Value

A pointsTile object, used only as an input to tile.

pointsTile-specific parameters

A call to pointsTile must provide an orthogonal pair of the following inputs:

x

coordinate vector of data to plot, attached to the x axis.

y

coordinate vector of data to plot, attached to the y axis.

top

coordinate vector of data to plot, attached to the top axis.

right

coordinate vector of data to plot, attached to the right axis.

Users will often wish to provide the following input:

plot

scalar or vector, the plot(s) in which this trace will be drawn; defaulting to the first plot. Plots are numbered consecutively from the top left, row-by-row. Thus in a 2 x 3 tiling, the first plot in the second row is plot number 4.

In addition to these pointsTile-specific parameters, users may provide any of the generic tile parameters documented below.

Generic tile graphical parameters

The inputs in this section may be given to any trace creating function in the tile package, though in some cases the parameter will have no effect for obvious reasons. These inputs are documented in three groups: 1. Parameters mimicking the grid parameters, 2. Parameters for sophisticated color selection, and 3. Other generic tile trace parameters.

  1. The following graphics parameters mostly mimic the gpar parameters of the grid package, and can be given as inputs to any tile trace-making function. Starred (*) parameters accept vector as well as scalar input, so that different parameter values can be applied to different elements of the trace:

    fill

    *Color for filling polygons; default is transparent.

    col

    *Color for lines, symbols, and text; default is black.

    lty

    *Line type; default is solid.

    lwd

    *Line width; default is 1.

    cex

    *Multiplier applied to fontsize; default is 1.

    lex

    *Multiplier applied to linewidth; default is 1.

    fontsize

    Size of the text in points; default is 12.

    lineheight

    Height of a line as a multple of the size of text; default is 1.2.

    fontfamily

    The font family; default is "".

    fontface

    The font face (bold, italic, etc.); default is plain.

    alpha

    Alpha channel for transparency; default is 0.8.

    polyalpha

    Alpha channel for transparency of polygons only; default is 0.8.

    lineend

    Line end style (round, butt, square); default is round.

    linejoin

    Line join style (round, mitre, bevel); default is "round".

    linemitre

    Line mitre limit, must be greater than 1; default is 10.

  2. The color of plotted elements can be most simply controlled by providing a scalar or vector of colors to col above. More detailed control is available:

    color

    List, advanced color controls (overrides col). Use these options if you wish to create colors with equal perceptual spacing (ie, select colors based on their location in the polarLUV space). Normally, users will want to provide data and colorset, and possibly bins or breaks. The remaining inputs allow very fine control of colors, but the defaults should work well in almost all cases:

    data

    A vector of numeric data to be encoded on the plot through varied colors.

    bins

    Scalar, either the number of bins to sort data into, or the name of an algorithm used by hist to bin data. Default is Sturges. Not needed if breaks are provided.

    breaks

    Vector, the values separating the different bins of data. Overrides bins.

    colorset

    Scalar, which schema governs color selection: sequential, diverge, heatmap, terrain, categories, or brewer. Most choices are documented in the package colorspaces under sequential_hcl. sequential (the default) produces a range of colors with the same hue but progressively lighter colors by perceptually equal steps; diverge produces a range of colors centered on a neutral desaturated color, and ranging outwards to two fully saturated hues on either side by perceptually equal steps; heatmap ranges from a dark, colorful red to a light, desaturated yellow by perceptually equal steps; terrain ranges from a dark, colorful green to a light, desaturated brown by perceptually equal steps; rainbow produces colors of equal chroma and equally spaced hue; categories produces colors directly from hcl, and brewer returns selected colors for categorical displays as recommended by the package RColorBrewer.

    hue

    A scalar or vector of hue values between 0 and 360. For colorset="sequential", this is a scalar reflecting the common hue of all plotted colors. For colorset="diverge", colorset="heatmap" or colorset="terrain", hue is a two-vector of the two hues used for extreme values of data. For colorset="rainbow", hue is a two-vector giving range in which equally spaced hues are selected. For colorset="categories", hue is a vector of arbitrary length giving the hues desired for different categories of data. hue has no effect if colorset="brewer". Default varies by colorset.

    chroma

    A scalar or vector of chroma values between 0 and 100. For colorset="sequential", colorset="heatmap" or colorset="terrain", this is a two vector reflecting the range of chroma used from low to high values of plotted data. For colorset="diverge", chroma is a scalar of the chroma used for extreme values of data. For colorset="rainbow", chroma is a scalar giving the common chroma for all plotted colors. For colorset="categories", chroma is a scalar or vector of arbitrary length giving the chroma desired for different categories of data. chroma has no effect if colorset="brewer". Default varies by colorset.

    luminance

    A scalar or vector of luminance values between 0 and 100. For colorset="sequential", colorset="diverge", colorset="heatmap" or colorset="terrain", this is a two vector reflecting the range of luminance used from low to high values of plotted data. For colorset="rainbow", chroma is a scalar giving the common luminance for all plotted colors. For colorset="categories", luminance is a scalar or vector of arbitrary length giving the luminance desired for different categories of data. luminance has no effect if colorset="brewer". Default varies by colorset.

    power

    Control parameter determining how chroma and luminance should be increased (1 for linear, 2 for quadratic, etc.). Default varies by colorset.

    gamma

    Scalar, gamma value of display. Default is 2.4.

    fixup

    Logical, corrected colors to a valid RGB value. Default is TRUE.

  3. These final graphical parameters are specific to tile plots, and tweak the appearance of traces. Starred (*) parameters accept vector as well as scalar input, to apply different parameters to different elements of the trace:

    markers

    Logical, plot symbols at data points; default is FALSE for no plotting

    labels

    *Text to plot at datapoints; default is to plot no text.

    labelxoffset

    *Horizontal offset for labels, to avoid overplotting with symbols; default is 0.

    labelyoffset

    *Vertical offset for labels, to avoid overplotting with symbols; default is 0.

    size

    *Size of symbols to plot at datapoints if markers is TRUE; default is 1.

    pch

    *Symbol(s) to plot at datapoints if markers is TRUE; default is 1 (run example(points) to see symbols).

    addArrow

    Adds an arrowhead to the end of the plotted line; deault is FALSE.

    angleArrow

    The angle of the arrow head in degrees (smaller numbers produce narrower, pointier arrows); default is 30.

    lengthArrow

    A unit specifying the length of the arrow head (from tip to base); default is unit(0.25, "inches").

    endsArrow

    One of last, first, or both, indicating which ends of the line to draw arrow heads; default is last.

    typeArrow

    One of open or closed indicating whether the arrow head should be a closed triangle.

    just

    XXX

    hjust

    XXX

    vjust

    XXX

    rot

    XXX

    check.overlap

    XXX

    clip

    Clip graphic results to the plotting area(s) (on or off); default is on.

    lighten

    XXX

    layer

    Graphical elements with lower layer will be drawn later in the plotting process, and hence appear on top of elements with higher layer. By default, layer is 10, though polygons in this trace will be plotted at layer + X, and text labels and markers at layer - X.

Author(s)

Christopher Adolph cadolph@u.washington.edu

See Also

tile, scatter


chrisadolph/tileForShiny documentation built on Feb. 6, 2022, 12:34 a.m.