- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies

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

# How to plot a function in R?

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.

## Example

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

## Output

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

## Output

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

## Output

- Related Articles
- 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 write the plot title in multiple lines using plot function in R?
- How to change the background color of a plot created by 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 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 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?
- How to draw a violin plot in R?
- How to create a staircase plot in R?
- How to represent the legend in a plot created by using plot function with colored straight lines or stars in R?

Advertisements