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

Relocation of Intersection size number, Add exact number of set size on the set size bar plot, Remove the background from the set size bar plot. #205

Open
Jihyunchun71 opened this issue Nov 11, 2024 · 1 comment
Labels
help-request User requested help with the package

Comments

@Jihyunchun71
Copy link

Objective

  1. Relocation of Intersection size number
    : In the generated figure, the intersection size number is located within the barplot only at the highest bar plot. I want all the numbers located at the top of the bar plots.

  2. Add exact number of set size on the set size bar plot
    Just like the intersection size plot, I want the exact number of set size to appear in the set size, but even after many trials, I failed. Please help me with it.

  3. Remove the background from the set size bar plot.
    I want to remove the stripe pattern and ticks behind the set size bar plot. I've removed the backgrounds in intersection size plot, but couldn't removed it in set size plot. I want the set size plot background to be just white.

Code

organs = c("Feces", "Muscle", "Serum")

upset(
RP,
organs,
name = 'organs',
stripes = upset_stripes(
colors = c("grey95", "white"),
geom = geom_segment(size = 20)
),
sort_intersections_by = c('degree', 'cardinality'),

base_annotations = list(
'Intersection\nsize' = intersection_size(
counts = TRUE,
mapping = aes(fill = Direction)
) +
scale_fill_manual(
values = c("Up" = "#B2182B", "Down" = "#2166AC", "etc" = "#D9D9D9"),
breaks = c("Up", "Down", "etc"),
labels = c("Up", "Down", "etc")
) +
theme(
panel.grid = element_blank(),
axis.line = element_line(),
axis.line.x = element_blank(),
axis.text.x = element_blank(),
axis.ticks.x = element_blank(),
axis.ticks.y = element_line()
)
),

matrix = intersection_matrix(
geom = geom_point(size = 4), # Adjust dot size
segment = geom_segment(size = 1.3) # Adjust line thickness in intersection matrix
),

width_ratio = 0.2,
mode = 'distinct'
)

Screenshot or illustration

image

Context (required)

ComplexUpset version: 1.3.3

R version details
<!-- Please replace this line by output of R.Version() -->
R session information
<!-- Please replace this line by output of sessionInfo() -->
@Jihyunchun71 Jihyunchun71 added the help-request User requested help with the package label Nov 11, 2024
@krassowski
Copy link
Owner

@Jihyunchun71

  1. intersection_size has bar_number_threshold argument, I think you can set it to 0 to get what you want.
  2. Like this https://krassowski.github.io/complex-upset/articles/Examples_R.html#display-counts ?
  3. stripes='white'? See https://krassowski.github.io/complex-upset/articles/Examples_R.html#stripes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help-request User requested help with the package
Projects
None yet
Development

No branches or pull requests

2 participants