How to set a linetype for "empty points joined by lines"?

Viewed 186

I want to make a plot in ggplot2 like this

base

x <- 1:10
y <- rnorm(10) + x
df <- data.frame(x=x,y=y)
plot(x,y)
lines(x,y,type='c')

I like this type='c' style,R help tell me

"c" for empty points joined by lines

but how can I implement this type in ggplot2?

library(ggplot2)
ggplot(data=df,aes(x=x,y=y)) + geom_line() + geom_point(shape=21,size=3)

ggplot

I mean, how to make a blank between the empty points and the lines? which linetype should I choose?

thank you very much

1 Answers
Related