hadley/ggplot2 — Issue #399: When only one x or y value, setting breaks=NA doesn't make tick+grid disappear
Author: wch
Created: 2012-02-09 06:47:33+00:00
State: open

All these examples should have no tick marks or grid lines. But when there is only a single x or y value, the tick and gridline appears on that axis.

```R
# Both x and y have only 1 value
# ticks visible for x and y
dat <- data.frame(x = 1, y = 1)
ggplot(dat, aes(x=x, y=y)) + geom_point() +
scale_y_continuous(breaks=NA) +
scale_x_continuous(breaks=NA)

# More than one x value
# x tick disappears
datmx <- data.frame(x = 1:3, y = 1)
ggplot(datmx, aes(x=x, y=y)) + geom_point() +
scale_y_continuous(breaks=NA) +
scale_x_continuous(breaks=NA)

# More than one y value
# y tick disappears
datmy <- data.frame(x = 1, y = 1:3)
ggplot(datmy, aes(x=x, y=y)) + geom_point() +
scale_y_continuous(breaks=NA) +
scale_x_continuous(breaks=NA)
```