I am trying to move the y axis title towards the ticks. However, I'm having trouble doing this without cutting off the combmatrix labels. I've tried both with ggupset and ggplot functions. See reprex below.
Thank you for your help!
library(dplyr)
library(ggupset)
library(ggplot2)
tidy_pathway_member <-
gene_pathway_membership %>%
as_tibble(rownames = "Pathway") %>%
tidyr::gather(Gene, Member, -Pathway) %>%
filter(Member) %>%
select(- Member)
g <-
tidy_pathway_member %>%
group_by(Gene) %>%
summarize(Pathways = list(Pathway)) %>%
ggplot(aes(x = Pathways)) +
geom_bar() +
scale_x_upset()
g

g +
# Moves axis title towards ticks...but cuts off labels
theme_combmatrix(combmatrix.label.make_space = FALSE)

g +
# Also, moves axis title towards ticks...but cuts off labels
theme(axis.title.y = element_text(margin = margin(r = -100)))

Created on 2021-07-30 by the reprex package (v2.0.0)

This can be done in a tricky way.
The solution is to hide the y axis title and add text with
annotate()to the target position.Since you did not provide your data, I will show it on an example.
Original plot:
Version with
annotatein place of the y-axis title:You just need to set the appropriate
xandycoordinates andxliminsidecoord_cartesian.