公告
财富商城
积分规则
提问
发文
2019-09-02 14:34发布
虎瘦雄心在
Say there is lim (\lim_{x \to \infty}\left(\frac{x}{x - 1} - 2\right) )
(\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()
最多设置5个标签!
You can do something like this: