R GG高亮显示打印标签_键

R GG高亮显示打印标签_键,r,ggplot2,R,Ggplot2,我正在使用ggplot2绘制条形图,并使用gghighlight高亮显示特定的条形图 但是使用gghighlight也会在输出中打印一些标签键 我想删除打印在顶部绘图上的标签键 请帮忙 ggplot(data=plot, aes(x=subdomain_name, y=mean)) + geom_bar(stat="identity", color="blue", fill="blue",width = nrow(plot)/10)+ geom_text(aes(label=format(ro

我正在使用ggplot2绘制条形图,并使用gghighlight高亮显示特定的条形图

但是使用gghighlight也会在输出中打印一些标签键

我想删除打印在顶部绘图上的标签键

请帮忙

ggplot(data=plot, aes(x=subdomain_name, y=mean)) + 
geom_bar(stat="identity", color="blue", fill="blue",width = nrow(plot)/10)+
geom_text(aes(label=format(round(mean,2))),hjust=0)+
coord_flip() + theme(axis.line = element_blank(),axis.line.x = element_blank(),
axis.line.y = element_blank(),plot.margin=unit(c(-0.6,1,1,1),"cm"),
panel.background=element_blank(),panel.border=element_blank(),
axis.title.x = element_blank(),axis.title.y = element_blank() )
+ylim(0,max+(0.05*max)) + gghighlight(grepl('Domain',subdomain_name),
unhighlighted_colour = alpha("red",1),
label_key = NULL))

您应该像这样将label\u key设置为F:您也可以尝试使用
?指南

library(gghighlight)

ggplot(data=plot, aes(x=subdomain_name, y=mean)) + 
geom_bar(stat="identity", color="blue", fill="blue",width = nrow(plot)/10)+
geom_text(aes(label=format(round(mean,2))),hjust=0)+
coord_flip() + theme(axis.line = element_blank(),axis.line.x = element_blank(),
axis.line.y = element_blank(),plot.margin=unit(c(-0.6,1,1,1),"cm"),
panel.background=element_blank(),panel.border=element_blank(),
axis.title.x = element_blank(),axis.title.y = element_blank() )
+ylim(0,max+(0.05*max)) + gghighlight(grepl('Domain',subdomain_name),
unhighlighted_colour = alpha("red",1),
label_key = F))

在这种情况下,您需要
使用\u direct\u label=FALSE

库(ggplot2)
图书馆(GG)
情节