Plot functions with R

Xiaoou&AI
1 min readJul 13, 2020

Suppose you have a quadratic function, it’s a basic task to plot the function in many programming languages, here is how you achieve some basic results in R

Here is the output. Both refer to the same function. In the first graph it doesn’t look like a parabola because the x range is not right. The second graph adresses this issue by assigning -1 to 1 as function domain.

Although the curve function allows a simple plot of normal distribution.

curve(dnorm(x), from=-4, to=4)

--

--