相关疑难解决方法(0)

突出显示ggplot中的单个"条形图"

我想在条形图中为单个条形图选择颜色和填充图案(突出显示单个"条形图")

我想用另一种颜色填充的条形图是"Str"和"RB" 在此输入图像描述

ggplot(GZ.mean, aes(x=Group.1, y=B)) +theme_bw(base_size=20, base_family="Times")+
geom_bar(stat="identity",colour="black", width=.6, position = "dodge", ,fill="gainsboro") +geom_errorbar(my.limits, width=0.2) +
theme(axis.text.x=element_text(family="Times", colour="black", size=rel(1.2), angle=30, hjust=1, vjust=1))+
theme(axis.text.y=element_text(family="Times", colour="black", size=rel(1.2))) +   scale_y_continuous(limits=c(0,170))+geom_text(size=6,aes(label=c("a","d","c","e","b","d","d","b","bc","d", "bc"),hjust=offset.h, vjust=offset.v)) +
scale_x_discrete(limits=c("JdC", "Stu", "Str", "Bol", "WBr", "Rij4", "Bif", "ErL", "ZtG", "PdV", "RB")) +labs(x= "Variety", y= "Total Sugar concentration [mg * g-1 FW]")
Run Code Online (Sandbox Code Playgroud)

我已尝试使用"scale_fill_manual"和"scale_color_manual",但它仍然不起作用.

r bar-chart ggplot2

2
推荐指数
1
解决办法
4116
查看次数

标签 统计

bar-chart ×1

ggplot2 ×1

r ×1