I am trying to add a line with custom intercept and tilt. I know what I can use geom_abline, but the line exceeds the graph fields. I have the following data.
>table
intent observed true
0 0.00 0.07
.1-.3 0.19 0.19
.4-.6 0.51 0.41
.7-.9 0.79 0.48
1 1.00 0.53
Here dput()
structure(list(intent = structure(c(4L, 1L, 2L, 3L, 5L), .Label = c(".1-.3",
".4-.6", ".7-.9", "0", "1"), class = "factor"), observed = c(0,
0.19, 0.51, 0.79, 1), true = c(0.07, 0.19, 0.41, 0.48, 0.53)), row.names = c(NA,
-5L), class = "data.frame", .Names = c("intent", "observed",
"true"))
This is my current solution.
table %>%
ggplot(aes(y=true,x=observed))+
geom_point()+
geom_smooth(method = lm,se=F,color="black",lty=2,size=1/2)+
geom_abline(intercept=0.07, slope=0.599,size=1/2)

The problem is what geom_ablineis the type of reference line. As such, it exceeds the edges of the graph by about 0 and does not fully appear below 0.8 along the x axis, in contrast to geom_smoothholding the line in the graph area. How can I do my work geom_ablinein geom_smoothorder to fit the area of ββthe schedule.