gaospecial / ggVennDiagram

A 'ggplot2' implement of Venn Diagram.
https://gaospecial.github.io/ggVennDiagram/
GNU General Public License v3.0
282 stars 38 forks source link

Wrong values displayed #72

Closed MargaGF closed 4 weeks ago

MargaGF commented 4 weeks ago

Hi all,

I have been using ggVennDiagram assuming that it would show me the species shared between two different treatments (as an example). My data sets look like this:

image

image

One set has 19 species and the other one has 25 species. I wanted to see how many species were shared between treatments, but the counts I get in the venn diagram do not make sense, as I know that there are species that are not shared from both treatments, and it is displaying a 0 for the second treatment, where the value should be 4, and the intersection value should be 15.

image

This is my code:

venndata_emf <- list(emf_soil_knp = as.character(rownames(emf_soil_knp)), emf_soil_urb = as.character(rownames(emf_soil_urb)))

emf_venn <- ggVennDiagram(venndata_emf, category.names = c("Soil KNP", "Soil urban"), label = "count") + scale_fill_gradient(low = "white", high = "black")

emf_venn

I hope you can let me know what am I doing wrong.

Cheers,

gaospecial commented 4 weeks ago

I think that is because your rownames are 1:25 and 1:16, respectively. What you need should be ID, instead.

MargaGF commented 4 weeks ago

Hi,

You are right! I just noticed by looking more carefully. How embarrasing!

Thank you so much!

gaospecial commented 4 weeks ago

Hi,

You are right! I just noticed by looking more carefully. How embarrasing!

Thank you so much!

You are welcome.