Description Usage Arguments Value Examples
This function is very simillar to the show_cols()
in 'scales'. The
main difference is that this function returns a true ggplot2
object.
This allows for further customization.
1 2 | show_palette(cols, num_rows = "square", label_size = 5,
font_family = "Times", base_size = label_size, ...)
|
cols |
The colors to present in a matrix. If the values are named, these will be used for the cell label. If not, then the color value itself is used for the label. |
num_rows |
The number of rows to use or if the matrix should be as square as possible. |
label_size |
The size passed to |
font_family |
The font to use for thee plot. Default is "Times". |
base_size |
The base font size passed to |
... |
Any other information to pass to |
A ggplot2
object.
1 2 3 4 5 6 7 | pal <- c("#3fc5f0", "#42dee1", "#6decb9", "#eef5b2")
show_palette(pal)
show_palette(pal, num_rows = 1)
names(pal) <- paste("color", 1:4)
show_palette(pal)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.