Learn R Programming

R4RNA (version 1.0.0)

Create Blank Plot: Create a blank plotting canvas

Description

Creates a blank plotting canvas with the given dimensions, along with functions to find best values for the canvas dimensions.

Usage

blankPlot(width, top, bottom, pad = c(0, 0, 0, 0), scale = TRUE, scale.lwd = 1, scale.col = "#DDDDDD", scale.cex = 1, debug = FALSE, png = NA, pdf = NA, factor = ifelse(!is.na(png), 8, 1/9), no.par = FALSE, asp = 1,...) maxHeight(helix)

Arguments

width
A number indicating the horizontal width of the blank plot.
top, bottom
The maximum and minimum values vertically to be displayed in the plot.
pad
An array of 4 integers, specifying the pixels of whitespace to pad beyond the dimensions given by top, bottom, and width. Four number corresponding to padding on the bottom, left, top and right, respectively. Default is c(0, 0, 0, 0).
scale
If TRUE, inserts a scale on the plot.
scale.lwd, scale.col, scale.cex
Allows manual modification of the scale's line width and colour, respectively.
png, pdf
If one or the other is set to a filename, a file in png or pdf format will be produced respectively. If both are set to non-NA values, png will have priority.
factor
The scaling factor used to produce plots of png or pdf format. Should be set so after multiplication of the top, bot, etc arguments, good document dimension in pixels with png and inches for pdf will be produced.
debug
If TRUE, frames the boundaries of the intended plotting space in red, used to determine if inputs produce expected output area. Also outputs to STDIN dimensions of the plot.
no.par
Suppresses the internal call to par in the function if set to TRUE, useful for using par arguments such as mfrow, etc.
asp
Controls and aspect ratio of the plot, defaultly set to 1, set to NA to disable completely.
...
Additional arguments passed to par when no.par is FALSE, common ones include ‘lwd’, ‘col’, ‘cex’ for line width, line colour, and text size, respectively. help('par') for more. When no.par is set to TRUE, this option does nothing, and manually calling par is required prior to the calling of this function.
helix
A helix data.frame

Value

maxHeight returns a numeric integer.

Details

blankPlot creates a blank plot with the given dimensions, with minimal margins around the plot and no axis or labels. If more control is required, using plot directly would be more efficient.

maxHeight returns the height that the highest helix would require, and can be used to determine top and bottom for blankPlot.

See Also

plotHelix

Examples

Run this code
    # Create helix and obtain height
    helix <- as.helix(data.frame(1, 37, 12, 0.5))
    height <- maxHeight(helix)
    print(height)

    # Use height to create properly sized plot
    width <- attr(helix, "length")
    blankPlot(width, height, 0)

    # Add helix to plot
    plotHelix(helix, add = TRUE)

Run the code above in your browser using DataLab