addbg: Add an opaque background to a plot when plotting

Description Usage Arguments Details Author(s) See Also Examples

View source: R/addbg.R

Description

Adds a transparent foreground and gridlines to plots to create the illusion of a background.

Usage

1
2
3
4
5
addbg(
  color = heat.colors(40, alpha = 0.15)[30],
  linecolor = "grey75",
  addgridlines = TRUE
)

Arguments

color

Background color. The default is a yellow from ' heat.colors that happens to look reasonable when alpha is applied.

linecolor

Color used for gridlines. Default is "grey75"

addgridlines

Add gridlines? Default is TRUE

Details

The background and gridlines can be slightly more professional looking and easier to read. The color can be customized, the default is heat.colors(40, alpha=.15)[30].

This is something that's nice if you're too pressed for time to do it using ggplot.

Uses the info in par("usr") to draw a rectangle that is the same size as your current plot area. Sometimes the transparency doesn't show up well when copied into other applications, so use at your own risk.

Author(s)

Gene Leynes

See Also

bgfun, plot100colors to see color examples ggplot Way better

Examples

1
2
3
4
     require(geneorama)

     plot(1:10)
     addbg()

geneorama/geneorama documentation built on Oct. 17, 2020, 12:35 a.m.