Hi

I created a ggplot with geom_point and two geom_line with each series from a different dataframe.

The x-coordinates for the points and lines do not line up as the points are random where as the lines are based on exponential type functions and used regularly spaced x-coords. Hence its not obvious how to merge them into one dataframe.

I assumed that the y values would share the same y-axis but recently I was asked to zoom into the plot and this assumption now appears wrong.

I tried using coord_cartesian and also pre-filtering the data but can see that the lines are crossing the points at very different locations. Thus in the original plot, a point my have been below the line but in the zoomed plot, the point now lies above the line.

So the zoomed plot looks radically different to the original. So presumably my layers are using different y-axis scales and the plots are wrong.

I think I have misunderstood how to combine layers in ggplot and so please suggest solution.

Here are my reprex. In the original the pit ioint lies above the line but in the zoomed version it is below. I have used spline. Perhaps the issue in this case is just the interpolation but in my actual example which is too complex to reproduce, this is not the case and there I think different y-axis scaling has been used.

```
require(ggplot2)
require(magrittr)
require(dplyr)
icexp=10
slexp=8
spdexp=1:8*.1-.7
tibexp<-tibble(spdexp,icexp,slexp)
tibexp%<>%dplyr::mutate(expexp=exp(slexp*spdexp+icexp)/1000)%>%
dplyr::select(-slexp,-icexp)
tibexp<-as.data.frame(spline(tibexp$spdexp,tibexp$expexp))
tibpnt<-tibble(x=-.05,y=15)
ggplot() +
geom_point(data=tibpnt, aes(x=x, y=y),shape=21, alpha=1, size =10) +
theme_bw() +
geom_line(data=tibexp,aes(x=x,y=y),color="red",size=4,alpha=.3)+
theme(text = element_text(size = 45))
```

```
require(ggplot2)
require(magrittr)
require(dplyr)
icexp=10
slexp=8
spdexp=1:2*.1-.2
tibexp<-tibble(spdexp,icexp,slexp)
tibexp%<>%dplyr::mutate(expexp=exp(slexp*spdexp+icexp)/1000)%>%
dplyr::select(-slexp,-icexp)
tibexp<-as.data.frame(spline(tibexp$spdexp,tibexp$expexp))
tibpnt<-tibble(x=-.05,y=15)
ggplot() +
geom_point(data=tibpnt, aes(x=x, y=y),shape=21, alpha=1, size =10) +
theme_bw() +
geom_line(data=tibexp,aes(x=x,y=y),color="red",size=4,alpha=.3)+
theme(text = element_text(size = 45))
```