首页 > 解决方案 > 向gglot添加填充颜色

问题描述

目标:我正在尝试将填充颜色添加到我的列车。

当前尝试:备忘单中的方法显示了函数 scale_fill_manual(values = c("","","")) 或 scale_fill_brewer(palette = "Greens")。这两种选择都没有奏效。

library(ggplot2)
library(tidyverse)
library(RColorBrewer)
d <- ggplot(dataset3, aes(x = DropoffLocationName, y=Difference)) + geom_col() + theme_test() 
d + scale_fill_manual(values = c("Red","Orange","Yellow","Green","Blue","Purple"))  
d + scale_fill_brewer(palette = "Greens")

那么,有什么想法吗?

标签: rggplot2

解决方案


推荐阅读