USGS-R / gsplot

plotting foundation for timeseries reporting
Other
6 stars 14 forks source link

Date axis #434

Closed jiwalker-usgs closed 7 years ago

jiwalker-usgs commented 7 years ago

Adds some utilities to handle special date axes. Not sure it handles all the cases we want to deal with, but this is hopefully a good start.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.8%) to 80.271% when pulling c04b6ce0abf961a5c2cb6433d25dca2da8bf1ad6 on jiwalker-usgs:dateAxis into 91f28d670bee464ffe75cec66b3d3a0262f3dd09 on USGS-R:master.

ldecicco-USGS commented 7 years ago

I just took it for a test ride, looks good! I'd say it's ready to merge. I'm not sure if this would be appropriate for this PR, or a new feature, but I would like to do something like:

x <- seq(as.Date("2013-01-22"), as.Date("2013-10-02"), "days")
y <- rnorm(length(x), 71, 19)
gs <- gsplot() %>%
  points(x, y) %>%
  date_axis(side=1, pos.lab="interval", tick.int="month", snap.to="month") %>%
  axis(side=c(3,4), labels = FALSE) %>%
  grid()
gs

And have the ticks line up on side 3 with side 1. What I see is: image

jiwalker-usgs commented 7 years ago

Yeah, that definitely should work, I'll make an issue as it is probably a bit involved to be able to inherit lazy eval'd limits.