plotColor | R Documentation |
Plot vector of colors and their labels in order to preview them for later use
plotColor(color_v, title_v = NULL, save_v = F, pch_v = 15, cex_v = 3)
color_v |
- character vector of color names, hex codes, etc. to be plotted. If named, the names will be plotted as well. |
title_v |
- optional title for plot. Default is NULL |
save_v |
- logical. F - print to console without saving; T - save file to working directory. File name will be title_v with spaces changed to underscore. If title_v is NULL, title is 'colors.pdf' |
pch_v |
- standard graphical parameter controlling point type. Default is 15 (square). see ?pch for list of options |
cex_v |
- standard graphical parameter controlling point size. Default is 3. |
print plot to stdout or to file
col1 <- c("red", "blue", "black", "green"); names(col1) <- col1
col2 <- c("#1B9E77", "#D95F02", "#7570B3", "#E7298A", "#66A61E", "#E6AB02", "#A6761D", "#666666")
plotColor(col1, title_v = "Named Colors")
plotColor(col2, title_v = "Hex Colors")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.