Peter B. Mandeville
1999-Jun-07 11:24 UTC
[R] How to superimpose a histogram and density plot
NCSS has a nice plot of the histogram and density plot superimposed. The S-PLUS 4 Guide to Statistics on page 45 suggests the following code for a general purpose density plot for a vector named data iqd <- summary(data)[5]-summary(data)[2] plot(density(data,width=2*iqd),xlab="x",ylab="",type="l") Is it possible to superimpose the density plot on a histogram produced with hist()? I tried lines(density(data,width=2*iqd),type="l") but the results weren't satisfactory. Thank you, Peter B. -- Peter B. Mandeville mandevip at deimos.tc.uaslp.mx Jefe del Depto. de Inform?tica y Bioestad?stica rpe1531 at pasteur.fmed.uaslp.mx Facultad de Medicine Tel: 48 26-23-45 ext. 232 Universidad Aut?noma de San Luis Potos? Fax: 48 28-23-52 Av. V. Carranza 2405 Col. Los Filtros Apartado Postal 145 San Luis Potos?, S.L.P. 78210 M?xico -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._