graph - How to plot exponential function on barplot R? -


so have barplot in y axis log (frequencies). eyeing it, appears bars decrease exponentially, know sure. want plot exponential on same graph. thus, if bars fall below exponential, know bars decrease either exponentially or faster exponential, , if bars lie on top of exponential, know dont decrease exponentially. how plot exponential on bar graph?

here graph if helps:

enter image description here

if you're trying fit density of exponential function, should plot density histogram (not frequency). see this question on how plot distributions in r.

this how it.

x.gen <- rexp(1000, rate = 3) hist(x.gen, prob = true)  library(mass) x.est <- fitdistr(x.gen, "exponential")$estimate  curve(dexp(x, rate = x.est), add = true, col = "red", lwd = 2) 

enter image description here


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -