Why when plotting a line with a linear model that contains two variables don't show properly? I'm doing simulations in R to see how it performs. I made a simple simulation with one variable like this:
set.seed(12345678)
n = 100
x.lm = rnorm(n = n, mean = 10, sd = 1)
beta0 = 2.5
beta1 = .8
err = rnorm(n = n, mean = 0, sd = 1)

# Linear combination 
y.lm = beta0 + beta1*x.lm + err

# Make a dataframe of the data 
df.lm = data.frame(x = x.lm, y = y.lm)
# Colour 
b.5 = scales::alpha("black",alpha = .5)
# PLot the data 
plot(y~x, data = df.lm, pch = 19, col = b.5)

# Model the data 
lm.out = lm(y~x, data = df.lm)
# Add a line to the plot 
abline(lm.out)

This works great as shown in the figure:

But when I add a second variable the abline is not showing the lines properly:
set.seed(12345678)
n = 100
x1 = rnorm(n = n, mean = 10, sd = 1)
x2 = rnorm(n = n, mean = 20, sd = 6)
# x1 = scale(x1)
# x2 = scale(x2)
beta0 = 2.5
beta1 = .8
beta2 = 3
err = rnorm(n = n, mean = 0, sd = 1)

# Linear combination 
y.lm = beta0 + beta1*x1 + beta2*x2 + err

# Make a dataframe of the data 
df.lm = data.frame(x1 = x1, x2 = x2, y = y.lm)

# Colour 
b.5 = scales::alpha("black",alpha = .5)

par(mfrow=c(1,2))
# PLot the data 
plot(y~x1, data = df.lm, pch = 19, col = b.5)

# Model the data 
lm.out = lm(y~x1+x2, data = df.lm)
# Add a line to the plot 
abline(a = coef(lm.out)["(Intercept)"], b = coef(lm.out)["x1"])

# PLot the data 
plot(y~x2, data = df.lm, pch = 19, col = b.5)
# Add a line to the plot 
abline(a = coef(lm.out)["(Intercept)"], b = coef(lm.out)["x2"])


Why is it making this? Also, if I scale the data prior to doing the linear combination, it works just fine. So why in the first example, I don't need to scale and in the second, I need to scale the x-variables?
 A: This has nothing to do specifically with R, it has to do with what an intercept represents. You asked R to plot a line starting at the intercept and with a slope corresponding to a single predictor in a 2-predictor model.
In default treatment coding of predictors, the intercept represents the estimated outcome when all predictors are at reference levels or have values of 0. If you just specify an intercept and the slope for one predictor (e.g., x2) in a two-predictor model, you are implicitly assuming that the other predictor (x1) has a value of 0. Your simulated mean value and slope for x1 were 10 and 0.8, respectively. It looks to me like the abline on the right plot is close to 8 units (= 10 * 0.8) below the bulk of the points.
The discrepancy is even worse for the left plot for x1. A line with an intercept of 2.5 and a slope of 0.8, with the hidden assumption that x2 = 0, means that the estimated y value even at x1 = 12, near the top of your values, is only 12.1, well below the limits of your plot. So the line you requested doesn't show up at all. You could see it if you specified wider y-axis limits, or if you adjusted the a value in your call to abline() to allow for a more representative value of x2.
The critical point about multiple-regression versus single-predictor regression slopes raised by @whuber should not be forgotten. But your biggest problem in visualization here is the hidden assumption about the value of the second predictor.
