ggplot出现的奇怪问题
library(ggplot2)
x = c(0, 1, 1, 0, 0)
y = c(0, 0, 1, 1, 0)
plot(x, y, type='l')
这个图是正确的
而如果用ggplot
ggplot() + geom_line(aes(x, y))
# ggplot(NULL, aes(x, y)) + geom_line()
这个图就是错误的,很奇怪。
x = c(0, 1, 1, 0, 0) + rnorm(5)*0.01
y = c(0, 0,...
原创
2021-11-08 21:31:21 ·
391 阅读 ·
0 评论