hadley/ggplot2 — Issue #282: Polar coordinate angles are not evenly spaced when x is a factor
Author: wch
Created: 2011-12-07 21:22:57+00:00
State: open

When x is a factor, polar coordinate angles aren't evenly spaced. Example:

```R
set.seed(111)
dat <- data.frame(x=sample(LETTERS[1:3], 30, replace=TRUE), y=rnorm(30, mean=5))

# A and C boxes touch - angle AC is smaller than AB and BC
ggplot(dat, aes(x=x, y=y)) + coord_polar() + geom_boxplot()
```

Test code:

```R
test_that("coord_polar angles are evenly spaced when x is a factor", {
set.seed(111)
dat <- data.frame(x=sample(LETTERS[1:3], 30, replace=TRUE), y=rnorm(30, mean=5))
p <- ggplot_build( ggplot(dat, aes(x=x, y=y)) + coord_polar() + geom_boxplot() )

expect_identical(p$panel$ranges[[1]]$theta.range, c(.5, 3.5))
}
```