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

ggplot labels with linebreaks inn ggvenn venn diagram #9

Closed
yanlinlin82 opened this issue Sep 4, 2020 · 1 comment
Closed

ggplot labels with linebreaks inn ggvenn venn diagram #9

yanlinlin82 opened this issue Sep 4, 2020 · 1 comment

Comments

@yanlinlin82
Copy link
Owner

Thank Anders for posting this question: https://support.bioconductor.org/p/133731/

library(ggvenn)
d<-data.frame(id=paste(LETTERS[1:9]),
           A=c(TRUE,TRUE,TRUE,FALSE,FALSE,TRUE,TRUE,FALSE,FALSE),
           B=c(FALSE,FALSE,TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,FALSE),
           C=c(FALSE,FALSE,TRUE,TRUE,FALSE,TRUE,TRUE,TRUE,FALSE))

p<-ggplot(d) +
  geom_venn(aes(A=A,B=B,C=C,label=id)) +
  coord_fixed()
  theme_void()
p

In the above code, the label of each intersection is collapsed by comma (,). It would be better to allow customize it.

yanlinlin82 added a commit that referenced this issue Sep 4, 2020
@yanlinlin82
Copy link
Owner Author

Try:

ggplot(d) + geom_venn(aes(A=A,B=B,C=C,label=id), label_sep = "\n")

or

ggvenn(d, show_elements = "id",  label_sep = "\n")

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

1 participant