ggplot2: Problem with x axis when adding regression line equation on each facet

后端 未结 2 1346
误落风尘
误落风尘 2020-12-11 11:24

Based on the example here Adding Regression Line Equation and R2 on graph, I am struggling to include the regression line equation for my model in each facet. However, I don

2条回答
  •  -上瘾入骨i
    2020-12-11 12:15

    Probably someone will suggest a better solution, but as an alternative, you can change stat_smooth_func and you can make the final row like this

    data.frame(x=1979, y=ypos, label=func_string)
    

    instead of

    data.frame(x=xpos, y=ypos, label=func_string)
    

    So, the plot will be like below

提交回复
热议问题