Learn R Programming

phonTools (version 0.1-6)

multiplot: Plot with variable panel sizes

Description

Create plots with columns or rows of unequal sizes.

Usage

multiplot (n = 2, type = 'r', sizes = rep (1/n, n), show = TRUE)

Arguments

n
The number of figure panels to be created.
type
If 'r', the panels will be arranged in rows, if 'c', the panels will be arranged in columns.
sizes
A vector indicating the percentage of the total width/height taken up by each row/column.
show
If TRUE, the resulting panel layout is shown to the user.

Details

This function is essentially a wrapper for the layout() function, which allows the user to create multi-panel figures in which each row or column is of a varying height/width. Pease note that small rows or columns might result in an error related to figure margins being too large when you try to create a plot. These may be reduced with the 'mar' parameter for the par() function, which sometimes solves the problem.

Examples

Run this code
data (sound)
# sound = loadsound ()       ## run this instead to select your own sound for this demo.

#par (mar = c(4,4,1,1))
#multiplot (n = 3, sizes = c(.25, .5, .25))  

#plot (sound)
#spectrogram (sound, pause = FALSE, dynamicrange = 50, maxfreq = 7000)
#powertrack (sound)

Run the code above in your browser using DataLab