gg2 <- ggplot(sector_measures, aes(sectorcode))
gg2 <- gg2 + geom_bar()
这里绘制出灰黑色部分
gg2 <- gg2 + geom_bar(aes(fill = gtaeval), position = "dodge")
这里是加上彩色部分
你这个程序实质是
ggplot(sector_measures, aes(sectorcode))+
geom_bar()+
geom_bar(aes(fill = gtaeval), position = "dodge")
而
p <- ggplot(gtayear, aes(startyear))
p + geom_bar()
是一幅图
下面的程序是另一幅图
p + geom_bar(aes(fill = gtaeval), position = "dodge") + ggtitle("The Change of The GTA over the year") +
labs(x = "Year", y = "The Measure of GTA")