[R] Help with axis labels

From: Tariq Perwez <tariq.perwez_at_gmail.com>
Date: Wed, 18 Jun 2008 12:59:18 -0400

I have patched together (from various sources) the following code to get semi-logarithmic plot. Unfortunately, my labels come out also at intermediate places between 10^2, 10^3, 10^4 etc. Since I put the code together from various sources and do not understand fully how the code is working, I have not been able to get rid of the labels like 10^1.69897, 10^2.69897 etc. I would appreciate if someone could modify the following code to solve this problem for me. Regards,


## Code follows

time <- c(0,30,60,90,120,150,180,210,240,270,300,330,360,390,410)

sk3222 <- c(19,46,73,130,190,358,632,1240,2340,4666,9422,17923,39448,72809, 149765)

plot(time,sk3222, yaxt="n",log ="y", xaxt="n", type= "o", las = 2, main = "Semi-logarithmic

axis(1, c(0,60,120,180,240,300,360,420))

axis.at <- 10 ^ c(0:10)

axis(2, at = 1:10 * rep(axis.at[-1] / 10, each = 10), tcl = -0.5, labels = FALSE) at <- axTicks(2)

axis(2, c(1:200000), at=at, labels=parse(text=paste("10^",log10(at))), las=2 )


        [[alternative HTML version deleted]]

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 Wed 18 Jun 2008 - 17:02:13 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 Wed 18 Jun 2008 - 18:30:50 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