admin管理员组

文章数量:1134555

I have figured out how to do most of the formatting changes on my upset plot but can't figure out how to move the y-axis label on the intersection size plot closer to the y-axis. I can move it up and down, but not further right.

library(extrafont) 
library(ComplexUpset)
library(data.table)
library(tidyverse)
library(extrafont)
library(dplyr)

movies = as.data.frame(ggplot2movies::movies)
genres = colnames(movies)[18:24]
movies[genres] = movies[genres] == 1
movies<-movies %>%
  head(2000) 

ComplexUpset::upset(
  movies,
  genres,
  name = "Genre Combination",
  width_ratio = 0.5,
  min_size = 2,
  set_sizes = FALSE,
  labeller = ggplot2::as_labeller(c('Drama' = 'LONG DRAMA LABEL', 'Comedy' =
                                      'LONG COMEDY LABEL')),
  base_annotations = list('Intersection size' = (
    intersection_size(text = list(
      vjust = 0.4,
      hjust = -0.1,
      angle = 90
    )) +
      theme(axis.title.y = element_text(hjust = -0.5, vjust = -1))
  )
  )
)

I tried using axis.title.y to change position. hjust moves the label up and down but vjust does not move the label left or right as expection.

I have also tried modifying the theme outside the "base annotations" section but I can't quite figure out what the difference is between the two.

本文标签: