In this graph, I’m presenting the patterns of antibiotic resistance for a specific bacteria. There are 2 organisms which are susceptible to all antibiotics (non-intersecting column), and the majority is resistant to at least one antibiotic. The problem is that when I plot the percent, the non-intersecting column appears as 100%, , it’s not included in the overall figure, with other patterns. How to solve it?
Thanks in advance
Code is as follows:
plot1 <- data2 %>%
select(site, organism,
Penicillins,
Cephalosporins,
Carbapenems,
Fluoroquinolones,
Aminoglycosides,
Tetracyclines) %>%
filter(organism == “Bacteria1”) %>%
upset(intersect = c(“Penicillins”,
“Cephalosporins”,
“Carbapenems”,
“Fluoroquinolones”,
“Aminoglycosides”,
“Tetracyclines”),
name = “”,
width_ratio = 0.1,
base_annotations = list(“Intersection ratio” =
intersection_ratio(
text = list(size = 3.5),
bar_number_threshold = 1,
text_colors =c(
on_background=”black”, on_bar=”white”),
mapping=aes(fill=”bars_color”),
text_mapping=aes(label=!!upset_text_percentage(digits = 1))) +
scale_fill_manual(values=c(“bars_color” = “grey”), guide= “none”) +
ylab(“Pattern percentn (Bacteria1)”) +
theme(axis.text.y = element_text(color=”black”,
size = 11)) +
theme(axis.title.y = element_text(color=”black”,
size = 11)) +
scale_y_continuous(labels=scales::percent_format(),
limits = c(0, 1),
breaks=seq(from = 0,
to = 1,
by = 0.15))
),
set_sizes = (FALSE)
)
And the output is attached
enter image description here
Expected to get the non-intersecting column included with other categories.
RE Services is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.