Learn R Programming

pkgndep (version 1.0.3)

plot.pkgndep: Plot method

Description

Plot method

Usage

# S3 method for pkgndep
plot(x, pkg_fontsize = 10*cex, title_fontsize = 12*cex, legend_fontsize = 8*cex,
    fix_size = !dev.interactive(), unit = "in", cex = 1, ...)

Arguments

x

The object from pkgndep.

pkg_fontsize

Fontsize for the package names.

title_fontsize

Fontsize for the titles.

legend_fontsize

Fontsize for the legends.

fix_size

Should the rows and columns in the heatmap have fixed size?

unit

The unit of the returned figure width and height.

cex

A factor multiplicated to all font sizes.

...

Other arguments.

Value

A list of two units that correspond to the width and height of the plot.

Details

If fix_size is set to TRUE. The size of the whole plot can be obtained by:

    size = plot(x, fix_size = TRUE)  

where size is a unit object with the width and height of the whole heatmap. If you want to save the plot in to e.g. a PDF file that has the same size of the heatmap, you need to make the plot twice. First save the plot into a null device, just to obtain the size of the plot:

    pdf(NULL) # a null device
    size = plot(x, fix_size = TRUE)
    dev.off()
    width = as.numeric(size[1])
    height = as.numeric(size[2])
    pdf(..., width = width, height = height)
    plot(x)
    dev.off()  

If there are no dependency packages stored in x, NULL is returned.

Examples

Run this code
# NOT RUN {
# See examples in `pkgndep()`.
# }

Run the code above in your browser using DataLab