See the FAQ: How to do a minimal reproducible example reprex
for beginners for the preferred way to ask coding questions.
suppressPackageStartupMessages({
library(ggplot2)
})
# generate fake data
set.seed(137)
VPD <- sample(seq(0, 1.5, 0.01), 500, replace = TRUE)
X1 <- sample(seq(50, 300, 5), 500, replace = TRUE)
Merged <- data.frame(VPD = VPD, X1 = X1)
# data from post
xv <- seq(0.15, 1.1, 0.1)
yv <- exp(5.67775) * xv^0.36681
obj <- data.frame(xv = xv, yv = yv)
# base graphics
plot(X1 ~ VPD)
lines(xv, yv, col = 2, lwd = 1, lty = 1)
# ggplot
p <- ggplot(Merged,aes(VPD,X1)) +
geom_point() +
geom_line(obj,mapping = aes(xv,yv), color = "red", size = 1.5) +
theme_minimal()
p