- Related Questions & Answers
- How to plot a function with ggplot2 in R?
- How to create a plot in R with gridlines using plot function?
- How to create a plot in R with a different plot window size using plot function?
- How to create a horizontal bar plot using barplot function in R?
- How to change the background color of a plot created by using plot function in R?
- How to write the plot title in multiple lines using plot function in R?
- How to add a mathematical expression in axis label in a plot created by using plot function in R?
- How to change the axes labels using plot function in R?
- How to draw a violin plot in R?
- How to create a staircase plot in R?
- How to put labels on a scatterplot that is created plot function in R?
- How to create a line chart in R using plot function with larger width?
- How to save a plot in pdf in R?
- How to change the position of the title of a plot which is created using plot function in R?
- How to join points on a scatterplot with smooth lines in R using plot function?

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

Plotting a function in R is not a difficult task. We can do it simply with curve function but if the function is very complex then it inside curve function might be difficult. It totally depends on the understand of the person who wants to plot the function, if he or she is well versed with the function then it won’t take much time, otherwise it becomes tedious.

> curve(exp(x),from=0, to=10)

> curve((x-1)/(x^2),from=0, to=20,ylab="y")

> curve(((exp(x))^2)/(x),from=20, to=100,ylab="y")

Advertisements