Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我和ggplot一起工作。我想用 ggplot 设计一个图形。该图形有两个连续变量,但我想得到这样的图形:
其中 x 和 y 是连续变量。我的问题是我无法让它在情节的线上显示圆圈。我希望该图对来自连续变量的每对观察值都有圆圈。例如,在附图中,它有一个圆圈表示对(1,1)和。有可能得到吗?(线条的颜色无关紧要。)(2,2)(3,3)
(1,1)
(2,2)
(3,3)
# dummy data dat <- data.frame(x = 1:5, y = 1:5) ggplot(dat, aes(x,y,color=x)) + geom_line(size=3) + geom_point(size=10) + scale_colour_continuous(low="blue",high="red")
玩低/高会改变颜色。
通常,要删除图例,请使用+ theme(legend.position="none")
+ theme(legend.position="none")