[R] X-Axis Problem with Multhist Plot

Edward Wijaya ewijaya at gmail.com
Mon May 26 09:24:34 CEST 2008


I am creating a side-by-side histogram using "multhist" of PLOTRIX.
However, I can't seem to control the X-axis.

It yields the following X points in the axis:
1 3 5 7 9 13 17 21 25 29 33

with uneven spacing between x-ticks (see attached file).

Especially I want to create a bar for every x-axis (1,2,3,4...36),
now not every x-axis has a bar.

Is there a way to alter my following code
so that the x axis is evenly distributed:

require(plotrix)
dat <- read.table(file="GDS1096.modelout", head = FALSE )

l <- list(dat$V2,dat$V3)
multhist(l, ylab = "Frequency", beside = TRUE,
         freq = TRUE,  col = c("blue","red"),
         xlab = "Nof Component",
         xlim = c(0,max(dat$V3)+25),
         ylim = c(0,10000))
legend(30, 8000, c("AIC", "BIC"), fill=c("blue", "red"))

Regards,
Edward
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Rplots.pdf
Type: application/pdf
Size: 11807 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20080526/bfb907ef/attachment.pdf>


More information about the R-help mailing list