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: Include empty sets #39

Closed
maia-sh opened this issue Aug 16, 2023 · 2 comments
Closed

Feature request: Include empty sets #39

maia-sh opened this issue Aug 16, 2023 · 2 comments

Comments

@maia-sh
Copy link

maia-sh commented Aug 16, 2023

I would like to include an empty set in an UpSet plot. I see #38 on the inclusion of empty intersections, but I've not managed to include an empty set.
Is this currently possible and if so how?
upset-empty-set

@const-ae
Copy link
Owner

Hi Maia,

this sounds like a reasonable feature. Unfortunately, I don't think I have implemented an option for it.

The problem is that I am specifically filtering out empty sets here https://github.com/const-ae/ggupset/blob/master/R/scale_upset.R#L192.

If I replace that line with sets <- self$sets, I can make the following plot:

image

However, I will not make this change, as I am not really actively working on this repo and don't know what kind of unintended consequences this change might have. Sorry.

Depending how much you want this feature, I recommend cloning this repo and making the change yourself.

Best,
Constantin

@const-ae
Copy link
Owner

const-ae commented Aug 16, 2023

This is the code I used to generate the plot, after changing line 192:

  tidy_movies %>%
    distinct(title, year, length, .keep_all=TRUE) %>%
    ggplot(aes(x=Genres)) +
    geom_bar() +
    scale_x_upset(n_intersections = 20, sets = c("Comedy", "Action", "Empty set"))

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