Say there is lim (\lim_{x \to \infty}\left(\frac{x}{x - 1} - 2\right)
)
it is =-1. How can i get plot with this value is indicated? To be more clearly i want plot like this
how to get it?
Say there is lim (\lim_{x \to \infty}\left(\frac{x}{x - 1} - 2\right)
)
it is =-1. How can i get plot with this value is indicated? To be more clearly i want plot like this
how to get it?
You can do something like this:
my_func <- function(x) x / (x - 1) - 2
library(ggplot2)
ggplot(data.frame(x = 0), aes(x)) +
stat_function(fun = my_func, aes(colour = "Function")) +
geom_hline(aes(yintercept = -1, colour = "Asymptote")) +
scale_colour_manual(values = c("Asymptote" = "blue", "Function" = "orange")) +
xlim(-10, 10) +
theme_minimal()