Change granularity of function plot to make plot look smooth

137 Views Asked by At

Using the R plot function to plot another function, how can I increase the granularity so that the graph looks smooth? I.e. something analogous to seq(by=.001)?

plot(sin, to=100)

plot(sin, to=100) has jagged edges

1

There are 1 best solutions below

1
On BEST ANSWER

Try plot(curve(sin, ...)), and then set n= to your desired resolution.

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

curve with n=101

curve with n=1001