tdhock / animint

animated and interactive web graphics
146 stars 37 forks source link

scales should be trained after removing NA #167

Open tdhock opened 8 years ago

tdhock commented 8 years ago

as it is, scales are trained before removing NA rows (which will not be plotted). an example where this is problematic (but not a huge problem) is described in comments in test-renderer1-text.R https://github.com/tdhock/animint/blob/NA-separate-lines/tests/testthat/test-renderer1-text.R#L6-L11

tdhock commented 8 years ago
viz <- list(
  yNA=ggplot()+
    geom_point(aes(x, y),
               data=data.frame(x=1:3, y=c(1:2, NA))),
  xNA=ggplot()+
    geom_point(aes(x, y),
               data=data.frame(y=1:3, x=c(1:2, NA))))
animint2dir(viz)

makes http://bl.ocks.org/tdhock/raw/b0181e6caebfb60cfea01e1583b8ccad/

seems to be a problem in ggplot2 as well

ggplot2-scales-bug

tdhock commented 8 years ago

i posted an ggplot2 issue https://github.com/hadley/ggplot2/issues/1711

tdhock commented 8 years ago

apparently hadley does not think this is an issue, but it still does not make sense to me