T.Meyer
T.Meyer

Reputation: 55

How to combine two graphs in R?

I have a histogram and a curve and want to draw them on a single chart. how can i do this?

hist(rexp(n, 3))
curve(dnorm, from=0, to=1, n)

Upvotes: 0

Views: 91

Answers (1)

Hasan Jafarov
Hasan Jafarov

Reputation: 628

Add curve 'add=TRUE'.

hist(rexp(n, 3))
curve(dnorm, from=0, to=1, n,add=TRUE)

Upvotes: 1

Related Questions