plotflow (version 0.2.1)

merge_pdf: Merge Different Sized Plots

Description

Allows for merging of different sized R plots.

Usage

merge_pdf(n.plots, file, widths = 8, heights = 8, n.lines = 1)

Arguments

n.plots

The number of plots to be combined.

file

A connection, or a character string naming the file to print to.

widths

A vector of widths equal to n.plots or a single value that will be used for all plot widths.

heights

A vector of heights equal to n.plots or a single value that will be used for all plot widths.

n.lines

A vector of integer values indicating the number of lines each plotting sequence will take. Default is 1 line each.

Value

Returns a single combined plot of various sizes.

Examples

Run this code
# NOT RUN {
merge_pdf(3, file = "foo.pdf", widths = c(7, 7, 10), heights = c(6, 10, 7))
plot(1:10)
plot(1:10, pch=19)
plot(1:10, col="red", pch=19)

library(ggplot2)
p <- ggplot(mtcars, aes(factor(cyl), mpg)) + geom_boxplot()
merge_pdf(2, file = "bar.pdf", widths = c(7, 10), heights = c(6, 10))
plot(1:10)
print(p)
# }

Run the code above in your browser using DataCamp Workspace