I can successfully add a geom_segment line with arrows to a plot when it is displayed singly,
pl <- ggplot(df.melted, aes(x=energy, y=intensity))
pl <- pl + geom_line(aes(color=series))
pl <- pl + geom_segment(x=compRange[1], y=2E+10, xend=compRange[2], yend=2E+10, color=gg_color_hue(1), linewidth=0.5, linetype="dashed", arrow=arrow(ends="both", type="closed", length=unit(2, "mm")))
However when the plot is arranged in a grid with another plot the segment line does not display:
ps <- ggplot(dfOrigXRTS, aes(x=energy, y=diff))
ps <- ps + geom_point(color="blue", size=1)
grid.arrange(pl,ps,ncol=1,nrow=2,heights=c(2,1))
Versions of R and packages are as follows: R 4.4.0, ggplot2 3.5.1, gridExtra 2.4