ggtree icon indicating copy to clipboard operation
ggtree copied to clipboard

facet_plot dates not displaying correctly

Open ShelleyPeterson opened this issue 4 years ago • 1 comments
trafficstars

I'm aligning a tree to a set of data points to show relationship over time. My data set has sample number in the first column (corresponding to tree) and date in the second column (as.Date = TRUE). In the plot, the date is displayed as a number rather than date. Is there a way to adjust the contents of the X axis? I've tried adding "scale_x_date" in a variety of places and it just gave me errors.

`tree <- ggtree(phylo) + geom_tiplab()
d <- data.frame(label = dd$Number,
                value = dd$Date.Collected)
p2 <- facet_plot(tree, panel = "Date Collected",
                 data = d,
                 geom = geom_point,
                 mapping = aes(x = value))+

      theme_bw()

plot(p2)`

Prerequisites

  • [x] Have you read Feedback and follow the guide?
    • [x] make sure your are using the latest release version
    • [x] read the documents
    • [x] google your question/issue

Describe you issue

  • [x] Make a reproducible example (e.g. 1)
  • [x] your code should contain comments to describe the problem (e.g. what expected and actually happened?)

Ask in right place

  • [x] for bugs or feature requests, post here (github issue)
  • [x] for questions, please post to google group

ShelleyPeterson avatar Mar 30 '21 19:03 ShelleyPeterson

reproducible example pls.

GuangchuangYu avatar Mar 31 '21 02:03 GuangchuangYu