joshwlambert / DAISIEmainland

Simulate phylogenetic data on islands with a evolving mainland pool

Home Page:https://joshwlambert.github.io/DAISIEmainland/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

plot_daisie_mainland_data: reverse time axis

richelbilderbeek opened this issue · comments

This Issue came from #62.

From Josh's comments and code, I added this test:

test_that("Issue 64: reverse axes", {

  # The Endemic_singleton_MaxAge island species are plotted near
  # the edge of the plot but they should have the longest line.
  # This makes me think that the plot_daisie_mainland_data function
  # should plot "Time before present" on the x-axis.
  set.seed(
    1,
    kind = "Mersenne-Twister",
    normal.kind = "Inversion",
    sample.kind = "Rejection"
  )

  daisie_mainland_data <- DAISIEmainland::sim_island_with_mainland(
    total_time = 1,
    m = 100,
    island_pars = c(1.0, 0.5, 10, 0.1, 0.5),
    mainland_ex = 2,
    mainland_sample_prob = 1,
    mainland_sample_type = "complete",
    replicates = 1,
    verbose = FALSE
  )

  DAISIEmainland::plot_daisie_mainland_data(
    daisie_mainland_data = daisie_mainland_data,
    replicate_index = 1
  )
})

Here is the current and desired plot:

annotated

So, let's focus on the empirical data only, as this is where it happens.

Use 'time before present' now:

Screenshot from 2022-01-21 20-36-19

Now draw the lines to y = 0 :-)

Draw the lines to the present:

Screenshot from 2022-01-21 20-38-52

It's on develop, this Issue will close when that reaches master.

For my overview, I will already close it :-)