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

y-axis label for the left-side bar plot #210

Closed
HyprValent opened this issue Jan 16, 2023 · 4 comments
Closed

y-axis label for the left-side bar plot #210

HyprValent opened this issue Jan 16, 2023 · 4 comments

Comments

@HyprValent
Copy link

I'm currently using this package in order to produce some images that will be used by others for analysis.
In order to make it more understandable as a standalone image, I was looking into setting up a basic y-axis label on the leftside bar plot to explain what it means. Something like this:

image

Is this currently possible in the package? I tried looking through the docs and couldn't find anything.
Thank you!

@jnothman
Copy link
Owner

Try something like:

my_upset = UpSetPlot(...)
...
axes_dict = my_upset.plot(data)
totals_axes = axes_dict["totals"]
totals_axes.set_ylabel("Total observations")

@Xparx
Copy link

Xparx commented Mar 24, 2023

This example does not work for me,
upsetplot.__version__
'0.8.0'

import upsetplot
example = upsetplot.generate_counts()
axes_dict = upsetplot.plot(example)
totals_axes = axes_dict["totals"]
totals_axes.set_ylabel("blabla")

generates the figure
image

For some reason the label isn't drawn(?).
I'm kind of guessing it might be the sharey setting that is spooking it.
as totals_axes.set_xlabel("blabla") seems to work as expected.

@jnothman
Copy link
Owner

I've got a fix coming in 0.9.0, fixed in #243. In the meantime you'll need to use something like

my_upset = UpSetPlot(...)
...
axes_dict = my_upset.plot(data)
totals_axes = axes_dict["totals"]
label_axis = totals_axes.yaxis
label_axis.set_visible(True)
label_axis.set_ticklabels([])
label_axis.set_ticks([])
label_axis.set_label("Total observations")

@jnothman
Copy link
Owner

Actually, that's not working. We need a more substantial change to set a ylabel on totals plot. But you can set an xlabel fine.

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

3 participants