Reputation: 2926
In ggplot2
, I want to make an easy geom_point()
scatter plot, with the dots connected by a line. However, I want the lines not to touch the point, as for example in this graph but I do not seem to manage at all in ggplot2
.
Upvotes: 1
Views: 462
Reputation: 578
This is a hack but this might help
x=1:20
y=rnorm(20)
data=data.frame(x,y)
library(ggplot2)
ggplot(data,aes(x,y))+
geom_line()+
geom_point(size=4,color="white")+
geom_point()+
theme_bw()
Upvotes: 1