英文:
Remove borders on a violin plot
问题
我想移除我的小提琴图上的黑色轮廓 - 我不想要任何轮廓
请帮忙!小提琴图与一个箱线图分组。
不知道应该使用什么代码
谢谢
英文:
I want to remove the black outline on my violin plot - I don't want an outline at all
Please help! The violin plot is grouped with a box plot.
Can't work out what code I should use
Thanks
答案1
得分: 2
"The "outline" of geom_violin
is controlled by the linewidth
parameter, just set it to zero in your geom_violin
."
英文:
The "outline" of geom_violin
is controlled by the linewidth
parameter, just set it to zero in your geom_violin
.
library(tidyverse)
ggplot(diamonds, aes(cut, price)) + geom_violin(linewidth = 0)
<!-- -->
<sup>Created on 2023-05-11 with reprex v2.0.2</sup>
答案2
得分: 2
Another potential option is to set the colour to "transparent", i.e.
library(tidyverse)
ggplot(diamonds, aes(x = cut, y = price)) +
geom_violin(color = "透明")
<!-- -->
<sup>2023-05-11 创建,使用 reprex v2.0.2</sup>
英文:
Another potential option is to set the colour to "transparent", i.e.
library(tidyverse)
ggplot(diamonds, aes(x = cut, y = price)) +
geom_violin(color = "transparent")
<!-- -->
<sup>Created on 2023-05-11 with reprex v2.0.2</sup>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论