Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: plot the ontology #11

Closed
richelbilderbeek opened this issue Nov 1, 2021 · 7 comments
Closed

Feature request: plot the ontology #11

richelbilderbeek opened this issue Nov 1, 2021 · 7 comments
Assignees

Comments

@richelbilderbeek
Copy link
Collaborator

Dear DAISIEmainland maintainer,

Thanks for DAISIEmainland and its many plotting functions!

The plotting function that is missing however, is one to plot the ontology of species, i.e. that produces pictures such as this:

Screenshot from 2021-11-01 10-29-40

I know it is a hard problem to produce beautiful plots, yet from the thoroughness of DAISIEmainland I predict attempts at plotting this has been made. If I am correct, I predict this functionality has been removed as it did not always results in beautiful plots. If so, I'd prefer to be able to see 'ugly' plot over nothing at all, maybe even from a different package (DAISIEmainlandplot seems a pretty name to me :-) ).

What is the status and what are the plans for this plotting functionality?

@joshwlambert
Copy link
Owner

Thank you for the idea of having these scenarios be made with a plotting functions in R. The picture pasted above is made using Tikz (latex). I have not attempted to write a plotting function for these in the past, and the I feel the pay-off of having them be produced in R is not worth the time input required to write what I believe would be a substantial amount of code.

@richelbilderbeek
Copy link
Collaborator Author

Thanks for the clear answer!

Would you mind to have some experimental plotting added if I do it? It will not be clean and it can well be non-exported, it is just that I could use it.

@joshwlambert
Copy link
Owner

Feel free to write some plotting code, if you feel that the code is useful for the package once it is finished please make a pull request and if I agree it is useful it can be kept on the package. 😄

@richelbilderbeek
Copy link
Collaborator Author

richelbilderbeek commented Dec 5, 2021

Done!

Here is my favorite test:

test_that("interesting picture, with recolonisation", {
  set.seed(
    9,
    kind = "Mersenne-Twister",
    normal.kind = "Inversion",
    sample.kind = "Rejection"
  )
  mainland <- sim_mainland(
    total_time = 10,
    m = 10,
    mainland_ex = 1.0
  )

  # Clade goes extinct, but after island age
  mainland_clade <- mainland[[1]]
  plot_mainland_clade(mainland_clade)
  
  island <- sim_island(
    total_time = 1,
    island_pars = c(1, 1, 10, 12, 1),
    mainland = mainland_clade,
    mainland_sample_prob = 1,
    mainland_sample_type = "complete")
  plot_island(island)
})

The mainland clade (note that only until t = 1 is used):

Screenshot from 2021-12-05 21-11-30

The island:

Screenshot from 2021-12-05 21-11-43

@richelbilderbeek
Copy link
Collaborator Author

I am happy the pictures visualize all the info produced by sim_mainland and sim_island. Sure, they can be made more intuitive, but I need a closer look for that. Still, it is helpful that all information is visualized :-)

@joshwlambert
Copy link
Owner

Thanks for the new plotting functions. Can this issue be closed once the new code reaches main?

@richelbilderbeek
Copy link
Collaborator Author

Thanks for accepting! Sure, this Issue can be closed when it reaches main, or now :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants