简体   繁体   中英

Plot line function in R

I have a function

1.0 * (375 - 515) * exp(-0.01 * x) + 515

in which x = time in milliseconds. I would like to draw that line in an R plot within a given range of x (in my case between 80 and 250), with x on the x-axis and a given range 800-300 on the y-axis (the intersection between the axes being where x = 80 and y = 800).

How can I do this?

You could have a look at the curve function in R:

?curve

Something like this will get you started:

curve(1.0 * (375 - 515) * exp(-0.01 * x) + 515, from=80, to=250,ylim=c(300,800))

Why do you want the axes to intersect at (80,800)?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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