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

Request: Option to use names instead of counts in circles #4

Closed
rossellhayes opened this issue Feb 25, 2020 · 3 comments
Closed

Request: Option to use names instead of counts in circles #4

rossellhayes opened this issue Feb 25, 2020 · 3 comments

Comments

@rossellhayes
Copy link

Excellent package! I was wondering if you would consider an option to use text labels instead of counts inside the circles, allowing the package to be used to create "traditional" Venn diagrams, such as the first example from Wikipedia.

@yanlinlin82
Copy link
Owner

Thank you very much for your interest and kind suggestion! I will check and consider it.

yanlinlin82 added a commit that referenced this issue Feb 25, 2020
@yanlinlin82
Copy link
Owner

I have committed a new version, which supports a show_elements option. Could you please help to try it?

Here goes a quick view of the new feature:

# for list
list(A=1:3,B=3:6) %>%
   ggvenn(show_elements=TRUE)

# for data frame
data.frame(id=LETTERS[1:4],
           A=c(TRUE,TRUE,FALSE,FALSE),
           B=c(FALSE,TRUE,TRUE,TRUE)) %>%
  ggvenn(show_elements="id")

# for ggplot style using
data.frame(id=LETTERS[1:4],
           A=c(TRUE,TRUE,FALSE,FALSE),
           B=c(FALSE,TRUE,TRUE,TRUE)) %>%
  ggplot() +
  geom_venn(aes(A=A,B=B,label=id)) +
  coord_fixed() +
  theme_void()

@rossellhayes
Copy link
Author

This is excellent! It fulfills my use case perfectly, much appreciated!

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