Hi Anh,
How about the reply by Dimitris?
Kind regards,
miltinho
Brazil
---------- Forwarded message ----------
From: Dimitris Rizopoulos <dimitris.rizopoulos@med.kuleuven.be>
Date: Jun 16, 2008 4:05 AM
Subject: Re: [R] Superimposing Line over Histogram in Density Plot
To: Gundala Viswanath <gundalav@gmail.com>
Cc: r-help@stat.math.ethz.ch
try something like this:
x <- rnorm(200)
hist(x, col = "blue", freq = FALSE)
lines(density(x), col = "red", lwd = 2)
I hope it helps.
Best,
Dimitris
----
Dimitris Rizopoulos
Biostatistical Centre
School of Public Health
Catholic University of Leuven
On 6/19/08, Anh Tran <popophobia@gmail.com> wrote:>
> Hi all,
> What parameter should I feed to the hist function to draw a line, not bar
> graph for a histogram? Smoothed line would be great too.
> I've looked at curve() for normal distribution but it's not what I
need. I
> need some curve on top of the histogram (fit to the actual data). Just as a
> way to illustrate, rather than bargraph.
>
> Thanks
>
> --
> Regards,
> Anh Tran
> UCLA NeuroOncology Lab
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
[[alternative HTML version deleted]]