On 12-11-17 5:38 AM, bgnumis wrote:
Hi all,
I attach a picture, with my output plot.
I put this command to obtain it:
hist(MCT[,2],probability=TRUE,xlab=" ",ylab="Max",main="M distribution")
lines(density(MCT[,2]), lwd = 2)
The problem is that when I extract the "bell" is too high? And the higher
part doesn´t appear in the plot. There is some trick to adjust the line on
the plotted area?
You need to set ylim in your call to hist(). You can do it by trial and
error, or compute the numbers first via
h <- hist(MCT[,2], plot=FALSE)
and set
ylim <- range(c(0, h$density, density(MCT[,2])$y))
before you plot:
hist(MCT[,2], probability=TRUE, ylim=ylim, xlab=" ", ylab="Max", main="M
distribution")
lines(density(MCT[,2]), lwd = 2)
Duncan Murdoch
______________________________________________
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.