问题描述 投票:0回答:0
我尝试了legend.position =“ top”,也尝试了legend.box =“垂直”,但是什么都没有效用。

k1 %>% ggplot(aes(Alert,Sum, fill = Alert)) + geom_bar(stat = "identity") + facet_wrap(~ Model , nrow= 5) + coord_flip() + geom_text(aes(label = Sum), fontface = "bold") + theme(legend.position = "none")+ ggtitle("MODEL WISE ALERT COUNT")+ theme_grey(base_size = 22)+ theme(legend.position = "top") enter image description here 我找到了答案。

k1 %>% ggplot(aes(Alert,Sum, fill = Alert)) + geom_bar(stat = "identity") + facet_wrap(~ Model , nrow= 5) + coord_flip() + geom_text(aes(label = Sum), fontface = "bold") + ggtitle("MODEL WISE ALERT COUNT")+ theme_grey(base_size = 22)+ theme(legend.position = "bottom") + guides(fill=guide_legend(nrow=2,byrow=TRUE))

r ggplot2
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.