Hi,

I am trying to plot a distribution over a histogram with the polygon()
function. However I have to use this function after hist() and that
makes the polygon cover the histogram. I would prefer having the
histogram at the top layer and the polygon as the background. Is that
possible?

A workaround is to use pdf and set transparency but that still makes
the histogram wrongly colored since the part covered by the
transparant polygon is obfuscated.

Any help is very welcome, here is my code so far.

#graph it
hist(weights$Weight, freq=TRUE, breaks=breakpoints, main=wfiles[i])

#lines(dens)
polygon(dens$x, dens$y, border=NA, col=rgb(1,0,1,0.5))


/Thomas

______________________________________________
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.

Reply via email to