[R] Problem with circular::plot.circular()

Michael Kubovy kubovy at virginia.edu
Sun Mar 29 15:23:35 CEST 2009


Thanks so much. I have another question:

why the difference here:

require(circular)
c1 <- circular(pi/2 + .00000, zero = pi/2, rotation = 'clock')
c2 <- circular(pi/2 + .00001, zero = pi/2, rotation = 'clock')
opar <- par(mfrow = c(1, 2))
plot(c1, stack = TRUE, bins = 10000, main = expression(pi/2))
plot(c2, stack = TRUE, bins = 10000, main = expression(pi/2 + .00001))
par(opar)

On Mar 29, 2009, at 8:09 AM, Duncan Murdoch wrote:

> On 29/03/2009 7:39 AM, Michael Kubovy wrote:
>> require(circular)
>> c <- circular(rep(0, 20), zero = pi/2, rotation = 'clock')
>> plot(c, stack = TRUE, shrink = 1.5)
>> Can anyone tell me why the stack is offset from 0?
>
> It's a histogram, and the bin starts at zero, and runs to pi/10 (I'm  
> guessing, since it appears to choose 20 bins).
>
> You can see the binning effect if you set your data to
>
> c <- circular(runif(20, 0, 2*pi), zero=pi/2, rotation='clock')
>
> Set bins to 10000 and the offset will be undetectable:
>
> plot(c, stack = TRUE, shrink = 1.5, bins=10000)
>
> Duncan Murdoch




More information about the R-help mailing list