Skip to content
Prev 178650 / 398506 Next

truehist and density plots

Consider a vector of 100 elements (attached files). then, 

truehist(b)
lines(density(b[20:50]))

How is it possible to have density plots of all subsets like b[20:50] within histogram (without exceeding the max of historgram on y axis)?

Is it more clear?

Best,
--- On Tue, 4/28/09, Uwe Ligges <ligges at statistik.tu-dortmund.de> wrote:
From: Uwe Ligges <ligges at statistik.tu-dortmund.de>
Subject: Re: [R] truehist and density plots
To: "carol white" <wht_crl at yahoo.com>
Cc: r-help at stat.math.ethz.ch
Date: Tuesday, April 28, 2009, 5:42 AM
carol white wrote:
function of subsets of the vector on the histogram. So I use truehist in MASS
package and lines(density) as follows:
I do not undertsand what you mean. Can you please provide a *reproducible*
example?

Uwe Ligges
(see attached). how is it possible to make a graphics so that the density plot
of the subsets doesn't go beyond the maximum of all points in the complete
set?
http://www.R-project.org/posting-guide.html