[R] Log scales

Emily Gleeson emily.gleeson at met.ie
Tue May 21 18:35:53 CEST 2013


Thanks a million Uwe.
I used the following from a forum to do it and it worked out:

mylevels <-c(-150,-100,-50,-20,-10,-5,-2,-1,1,2,5,10,20,50,100,150)
cols <- jet.colors(length(mylevels) - 1)
customAxis <- function() {
   n <- length(mylevels)
   y <- seq(min(mylevels), max(mylevels), length.out=n)
   rect(0, y[1:(n-1)], 1, y[2:n], col=cols)
   axis(4, at=y, labels=mylevels)
}


Many thanks,
Emily



Uwe Ligges wrote:
>
>
> On 17.05.2013 13:34, Emily Gleeson wrote:
>> Dear All,
>>
>> I have a query about using log scales for filled.contour plots. I have
>> used log values on the x and y axes but labelled the axes with their
>> linear (non-log) values. I's like to do the same with the contour
>> values. I want the range to go from -100% to +100%. To use log I just
>> added 1000 to the % values before taking the log. I'd like the original
>> % values to appear on the contour lines and in the contour colourbar
>> labelling.
>
>
> One way would be to keep the original scale and set explicit breaks 
> for the levels of contour lines as needed.
>
> Best,
> Uwe Ligges
>
>
>> I'd appreciate any suggestions you have.
>>
>> Many thanks,
>> Emily Gleeson
>>
>>
>>
>> ********************************************************************************* 
>>
>>
>> This e-mail and any files transmitted with it are confid...{{dropped:9}}
>>
>> ______________________________________________
>> 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.


*********************************************************************************
This e-mail and any files transmitted with it are confid...{{dropped:9}}



More information about the R-help mailing list