r - ggplot: line with different widths -
with ggplot2, easy plot line 2 colours, based on value of "col" variable, possible plot line left part 1 width , right part 1 ?
you different width lines if use size=
argument inside aes()
, set variable divides data.
the of plot depend on variable divides data in groups.
if variable factors gap between parts of lines.
df1<-data.frame(x=1:10,y=1:10,z=rep(c("a","b"),each=5)) ggplot(df1,aes(x,y,size=z))+geom_line()
if variable numeric there no gap.
df2<-data.frame(x=1:10,y=1:10,z=c(1,1,1,2,2,2,3,3,4,4)) ggplot(df2,aes(x,y,size=z))+geom_line()
Comments
Post a Comment