I want to produce some boxplots and plot the logged values but have the axis scale in the original, not-logged scale. It seeming like I have the first few steps but I'm having trouble with the last. Here's what I'm doing (which I got for the documentation for boxplot and axis). How do I get the ticks to be labeled 2,5, and 9 of the original scale? a<-c(1,2,3,4,5,6,7,8,9,10) bcat<-c(1,1,1,2,2,2,2,3,3,3) boxplot(log(a)~bcat, yaxt="n") axis(2, tick=a) -- Dean Sonneborn, MS Programmer Analyst Department of Public Health Sciences University of California, Davis (530) 754-9516 (voice) (530) 752-3118 (fax) [[alternative HTML version deleted]]
Dean Sonneborn wrote:> I want to produce some boxplots and plot the logged values but have the > axis scale in the original, not-logged scale. It seeming like I have the > first few steps but I'm having trouble with the last. Here's what I'm > doing (which I got for the documentation for boxplot and axis). How do I > get the ticks to be labeled 2,5, and 9 of the original scale? > a<-c(1,2,3,4,5,6,7,8,9,10) > bcat<-c(1,1,1,2,2,2,2,3,3,3) > boxplot(log(a)~bcat, yaxt="n") > axis(2, tick=a) > >("tick" needs to be TRUE or FALSE!) Try axis(2, at=log(a), label=a) Or, maybe, to avoid the "10" label disappearing: lbl <- a; lbl[9] <- NA; axis(2, at=log(a), label=lbl)
Hi r-help-bounces at stat.math.ethz.ch napsal dne 09.04.2007 22:10:22:> I want to produce some boxplots and plot the logged values but have the > axis scale in the original, not-logged scale. It seeming like I have the> first few steps but I'm having trouble with the last. Here's what I'm > doing (which I got for the documentation for boxplot and axis). How do I> get the ticks to be labeled 2,5, and 9 of the original scale? > a<-c(1,2,3,4,5,6,7,8,9,10) > bcat<-c(1,1,1,2,2,2,2,3,3,3) > boxplot(log(a)~bcat, yaxt="n") > axis(2, tick=a)Is axis(2, at=log(a), labels=a) what you want? Regards Petr> > -- > Dean Sonneborn, MS > Programmer Analyst > Department of Public Health Sciences > University of California, Davis > (530) 754-9516 (voice) > (530) 752-3118 (fax) > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.
Hi Dean Sonneborn <dsonneborn at ucdavis.edu> napsal dne 10.04.2007 18:28:43:> Petr, > This is great! Thank you so much for responding. Could I get one more > point clarified. My A values range from 1 to 35. I would really like to > use something like > AT=1 to 35 by 5 instead of AT=log(a). at=log(a) plots all the messy > values. I'm hoping to get values like 1,5 10, 15...35. Is it possible to> do it like this?You need not use your original vector for labeling. You can use any other sequence of numbers, e.g. a.lab <- c(1,seq(5,35,5)) and use it for labeling. And beware of letters format AT is not at. Regards Petr> > Petr PIKAL wrote: > > Hi > > > > r-help-bounces at stat.math.ethz.ch napsal dne 09.04.2007 22:10:22: > > > > > >> I want to produce some boxplots and plot the logged values but havethe> >> axis scale in the original, not-logged scale. It seeming like I havethe> >> > > > > > >> first few steps but I'm having trouble with the last. Here's what I'm> >> doing (which I got for the documentation for boxplot and axis). Howdo I> >> > > > > > >> get the ticks to be labeled 2,5, and 9 of the original scale? > >> a<-c(1,2,3,4,5,6,7,8,9,10) > >> bcat<-c(1,1,1,2,2,2,2,3,3,3) > >> boxplot(log(a)~bcat, yaxt="n") > >> axis(2, tick=a) > >> > > > > Is > > axis(2, at=log(a), labels=a) > > > > what you want? > > > > Regards > > Petr > > > > > > > >> -- > >> Dean Sonneborn, MS > >> Programmer Analyst > >> Department of Public Health Sciences > >> University of California, Davis > >> (530) 754-9516 (voice) > >> (530) 752-3118 (fax) > >> > >> > >> [[alternative HTML version deleted]] > >> > >> ______________________________________________ > >> R-help at stat.math.ethz.ch 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. > >> > > > > > > -- > Dean Sonneborn, MS > Programmer Analyst > Department of Public Health Sciences > University of California, Davis > (530) 754-9516 (voice) > (530) 752-3118 (fax) > >