setVennPalette: Change the color palette for a diagram

View source: R/nVenn2.R

setVennPaletteR Documentation

Change the color palette for a diagram

Description

Change the color palette for a diagram

Usage

setVennPalette(nVennObj, palette = 0, plot = TRUE)

Arguments

nVennObj

nVenn object created with nVennDiagram().

palette

Either 0 (default), 1, 2 or 3. Each number defines a color palette that will be applied to the results

plot

If true (default), plots the diagram after applying the palette.

Details

The color palette for a diagram can also be set with setVennOpts(), but with a small difference. If a set color has been set with setVennColor(), setVennPalette() will override and delete that setting, while setVennOpts() will not. This way, one can have a color defined for a set and change the colors of the rest of sets with setVennOpts() or reset every color to the pre-defined palette with setVennPalette().

Value

nVenn object with the palette set to the requested value.

See Also

setVennOpts() for an alternative way to change the color palette.

Examples

myv <- nVennDiagram(list(Set1=c("a", "b", "c"), Set2=c("a", "c", "d")), verbose=FALSE)
myv <- setVennPalette(myv, 2)
myv <- setVennPalette(myv, 3)

nVennR2 documentation built on July 14, 2026, 1:09 a.m.