简体   繁体   English

更改函数图的粒度以使图看起来平滑

[英]Change granularity of function plot to make plot look smooth

Using the R plot function to plot another function, how can I increase the granularity so that the graph looks smooth?使用 R plot函数绘制另一个函数,如何增加粒度以使图形看起来平滑? Ie something analogous to seq(by=.001) ?即类似于seq(by=.001)东西?

plot(sin, to=100)

plot(sin, to=100) 有锯齿状的边缘

Try plot(curve(sin, ...)) , and then set n= to your desired resolution.尝试plot(curve(sin, ...)) ,然后将n=设置为您想要的分辨率。

curve(sin, from=0, to=100)         # default, n=101
curve(sin, from=0, to=100, n=1001)

n=101 的曲线

n=1001 的曲线

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM