| gl.colors | R Documentation |
Creates a vector of colors in hex (e.g. "#3B9AB2" "#78B7C5") based on user selected category (parameter type).
"2" [two colors]
"2c" [two colors contrast]
"3" [three colors]
"4" [four colors]
"structure" [35 discrete colors, suitable for structure-style plots]
"div", "dis", "con", "vir" [color palettes, see details]
gl.colors(type = 2, verbose = NULL)
type |
Type of color (2, 3 or 4 colors, "structure", or a palette type, see description) [default 2]. |
verbose |
Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log; 3, progress and results summary; 5, full report [default 2 or as specified using gl.set.verbosity]. |
A palette of colors can be specified via "div" [divergent], "dis" [discrete], "con" [convergent], "vir" [viridis]. Be aware a palette needs the number of colors specified as well. It returns a function and therefore the number of colors needs to be a part of the function call. Check the examples to see how this works.
A vector of colors in hex format, or, for the palette types ("div", "dis", "con", "vir"), a function taking the number of colors as its argument.
Author(s): Bernd Gruber. Custodian: Bernd Gruber – Post to https://groups.google.com/d/forum/dartr
Other graphics:
gl.map.interactive(),
gl.plot.heatmap(),
gl.plot.snp.density(),
gl.select.colors(),
gl.select.shapes(),
gl.smearplot(),
gl.tree.nj()
gl.colors(2)
gl.colors("2")
gl.colors("2c")
#five discrete colors
gl.colors(type="dis")(5)
#seven divergent colors
gl.colors("div")(7)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.