小编Joh*_*Ton的帖子

如何突出显示ggplot2中的列

我有下图,我想突出显示两个西瓜的列,因为它的juice_content和重量最高。我知道如何更改列的颜色,但我想突出显示整个列。关于如何实现这一点的任何想法?网上似乎没有任何类似的内容。

fruits <- c("apple","orange","watermelons")
juice_content <- c(10,1,1000)
weight <- c(5,2,2000)
df <- data.frame(fruits,juice_content,weight)
df <- gather(df,compare,measure,juice_content:weight, factor_key=TRUE)
plot <- ggplot(df, aes(fruits,measure, fill=compare)) + geom_bar(stat="identity", position=position_dodge()) + scale_y_log10()
Run Code Online (Sandbox Code Playgroud)

我要强调整个西瓜专栏。

r ggplot2

4
推荐指数
1
解决办法
123
查看次数

标签 统计

ggplot2 ×1

r ×1