我正在创建一个这样的条形图:
cyl.am <- ggplot(mtcars, aes(x = factor(cyl), fill = factor(am)))
cyl.am +
geom_bar()
我想用自己的颜色加点调味。但是,当我这样做时:
cbbPalette <- c("#000000", "#E69F00")
cyl.am +
geom_bar() +
scale_fill_brewer(palette = cbbPalette)
我收到以下警告信息,对这里出了什么问题的想法?
Warning messages:
1: In if (!palette %in% unlist(brewer)) { :
the condition has length > 1 and only the first element will be used
2: In pal_name(palette, type) : Unknown palette #000000#E69F00