[R] X-Axis Problem with Multhist Plot

From: Edward Wijaya <ewijaya_at_gmail.com>
Date: Mon, 26 May 2008 16:24:34 +0900


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



R-help_at_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.
Received on Mon 26 May 2008 - 07:29:36 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 26 May 2008 - 10:30:39 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive