Skip to content
Prev 306395 / 398506 Next

Comparing density plots using same axes or same axes scale

On Sep 26, 2012, at 6:13 PM, Rui Barradas wrote:

            
If you use matplot ,  presumably just plotting the y-values, you will need to set up the "from" and "to"  ranges in the calls to density() to be the same. Possibly with:

d.list <- apply(sag, 2, density, from= min(sapply(sag,min)), to=max(sapply(sag,max)) )
# then proceeding in sensible fashion.