Learn R Programming

plothelper (version 0.1.9)

showcolor: Show a Color Palette

Description

Simple function to show colors. NOTE: do not add coord_flip().

Usage

showcolor(x, label_size = 15, ...)

Arguments

x

a character vector of colors.

label_size

size of text on x-axis to show color names.

...

other arguments passed to geom_bar.

Examples

Run this code
# NOT RUN {
# A palette used by David Hockney
co=c("#833822", "#C03800", "#D3454C", 
	"#DC6A30", "#F29856", "#FEEF70", 
	"#A5D56D", "#16D670", "#00932F", 
	"#03592E", "#04B7B0", "#007BA9", 
	"#EC46BF", "#6A2C8F"
)
showcolor(co, label_size=10)
# }

Run the code above in your browser using DataLab