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

Any way to set the fig_size and highlighting subsets? #231

Closed
VergaJU opened this issue Nov 29, 2023 · 2 comments
Closed

Any way to set the fig_size and highlighting subsets? #231

VergaJU opened this issue Nov 29, 2023 · 2 comments

Comments

@VergaJU
Copy link

VergaJU commented Nov 29, 2023

I am trying to make an UpSet plot where I would like to highlight some subsets and specify the figure sizes, do you have any suggestions?

At now I managed to set the fig_size only with the function upsetplot.plot():

from upsetplot import generate_counts, UpSet, plot

example = generate_counts()

fig = plt.figure(figsize=(10,3))

plot(example, fig=fig, element_size=None)

plt.title("title")
plt.show()

Or highlight the subset using UpSet():

from upsetplot import generate_counts, UpSet, plot

example = generate_counts()

fig = plt.figure(figsize=(10,3))


upset = UpSet(example)
upset.style_subsets(present=["cat1"],
                    absent = ["cat0"],
                    facecolor="red",
                    label="Special")

upset.plot(fig=fig)
plt.title("title")
plt.show()

But even if I specify the matplotlib figure in the function UpSet.plot(), it doesn't respect the fig_size(). I tried with element_size but it doesn't work for the strict guidelines I have for the figure sizes.

Thank you

@jnothman
Copy link
Owner

Hi, have you tried upset = UpSet(example, element_size=None)? This seems to fix it for me.

@jnothman
Copy link
Owner

although the radius of those dots isn't great :(

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