z3tt/Z3tt

Suggestions

KittJonathan opened this issue · 1 comments

Hi Cédric ! Hope you're doing well.

I'm working through your tutorial, and I've got a couple suggestions :

  • line 244 : geom_line(color = "firebrick", linetype = "dotted", size = .3) -> use linewidth instead of size
  • line 385 : you can adjust the position of the text afterwards horizontally (0 = left, 1 = right) and vertically (0 = top, 1 = bottom) -> not sure I understand the vjust ajustments here ... shouldn't it be 0 = bottom and 1 = top ?

All the best,

Jonathan.

z3tt commented

Hi Jonathan,

Thanks for the feedback! Yes, I should use linewidth here, also to be consistent.
With regard to the vertical adjustment: top is actually zero, test it with this tiny chart:

library(ggplot2)

g <- ggplot(mpg, aes(displ, hwy)) + geom_point() 

g + geom_text(aes(label = year), vjust = 0)  ## moves label above points
g + geom_text(aes(label = year), vjust = 1)  ## moves label below points

Best, Cédric