Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以用 R 绘制以下函数?
$$\lim\limits _{x\to3^{+}}\, f(x)=2$$
$$\lim\limits _{x\to3^{-}}\, f(x)=1$$
基本上,我想看一个有 2 条曲线的图。如果可能的话,如何在曲线的末端制作一些圆圈(黑色或白色)......?
谢谢
定义一个分段连续函数:
ff <- function (xx) ifelse(xx<3,xx,xx+1)
绘制它的第一部分,保留足够的空间来绘制其余部分:
curve(expr=ff,from=0,to=2.999,xlim=c(0,6),ylim=c(0,7),xlab="",ylab="")
添加第二部分:
curve(expr=ff,from=3,to=6,add=TRUE)
添加一个小圆圈:
points(3,ff(3),pch=21,bg="black")
结果: