Hello, It could be my email client (gmail), but I had an error when trying to paste your data in. Anyway to answer part of your question
> # Draw the histograms > for (i in 1:length(ages)){ > par(new = TRUE) > xmin <- -ages[i] + xlim[1] I think your problem here might be that you have -ages[i] + xlim[1], or more clearly xmin <- xlim[1] - ages[i] My guess is that this is a typo that hides easily because of the assignment operator. That would explain why it keeps decreasing. > xmax <- xlim[2] - ages[i] > ser <- freqs[, i+1] > ser <- ser/max(ser) * barscale > barplot(ser, horiz = TRUE, axes = FALSE, xlim = c(xmin, xmax), > ylim = ylim, col = barcol, space = 0) > } Best, Josh <snipped the rest> ______________________________________________ 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.