blankPlot: Create a blank plotting canvas

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/plot.R

Description

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

Usage

1
2
3
4
5
    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

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.

Value

maxHeight returns a numeric integer.

Author(s)

Daniel Lai

See Also

plotHelix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
    # 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)

R4RNA documentation built on Nov. 8, 2020, 5:15 p.m.