powered by
A quick and dirty way to show colours in a plot.
show_col(colours, labels = TRUE, borders = NULL, cex_label = 1, ncol = NULL)
A character vector of colours
Label each colour with its hex name?
Border colour for each tile. Default uses par("fg"). Use border = NA to omit borders.
par("fg")
border = NA
Size of printed labels, as multiplier of default size.
Number of columns. If not supplied, tries to be as square as possible.
show_col(hue_pal()(9)) show_col(hue_pal()(9), borders = NA) show_col(viridis_pal()(16)) show_col(viridis_pal()(16), labels = FALSE)
Run the code above in your browser using DataLab