Thanks. I think I've got it. However, the density is plotted, not the
frequency. Is there a way to convert the density back to frequency.
Thanks a bunch.

Anh Tran

On Thu, Jun 19, 2008 at 3:33 PM, milton ruser <milton.ruser@gmail.com>
wrote:

> 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")
> 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.
>>
>
>


-- 
Regards,
Anh Tran

	[[alternative HTML version deleted]]

