# [R] plot log scale, axis original scale

Petr PIKAL petr.pikal at precheza.cz
Wed Apr 11 08:24:57 CEST 2007

```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 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
> >>
> > 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)
>
>

```