I'm new to R and I was trying to shift my plotting platform from something like Excel to R/ggplot2.
I'm having a difficult time making the scatter plot points join smoothly. I have some data:
p1 <- ggplot(DunnTib, aes(Vf, CV3, col = Rsq))+
geom_line()+
theme_bw()
p1
And the result it generates is something like this: ggplot2 result
The plot as I made it in Excel was much smoother: Excel 2013 result
I tried using geom_path() as well as geom_line() and adjusting the size but haven't found a better solution. Any tips on how to achieve the same level of smoothness
Edit: I've shared the complete data on Google Drive [link]. The lack of smoothness is more pronounced when a lot of points are used because they are so close together.
I also tried geom_path()
and while this is the kind of shape I want, a crisper line as it was in Excel would be preferable.
p1 <- ggplot(DunnTib, aes(Vf, CV3)) +
geom_path(size = 2, col = 'red')+
theme_bw()
p1
Edit: I've found a solution to my own question so I thought I'd add it here. What you're looking for is anti-aliasing. ggplot doesn't do anti-aliasing but a package called Cairo
does. Read about it here