假设有lim (\lim_{x \to \infty}\left(\frac{x}{x - 1} - 2\right) )

是=-1。如何获得具有此值的绘图?更清楚的是,我想要这样的情节
怎么弄到?

发布于 2018-10-27 13:49:12
你可以这样做:
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()

https://stackoverflow.com/questions/53022437
复制相似问题