gpt4 book ai didi

r - ggplot2 中的条形图

转载 作者:行者123 更新时间:2023-12-03 01:28:52 24 4
gpt4 key购买 nike

知道如何在 ggplot2 中绘制条形图吗?下面粘贴了基本 R 中的示例。

stripchart(iris$Sepal.Length, col = "red", method="stack")

enter image description here

最佳答案

您可以使用geom_dotplot:

library(ggplot2)
ggplot(iris, aes(x = Sepal.Length)) +
geom_dotplot()

enter image description here

关于r - ggplot2 中的条形图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25474242/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com