I have a VennDiagram that I wish to plot on top of a chart. I already know I can do this with patchwork::inset_element()
. The problem, though, is that the VennDiagram has a white blackground which is default to R Studio plots. I've been looking into magick
and trying to remove the Diagram's background, or make it transparent, so it'd essentially become a png image and wouldn't overlap with the chart data, but I can't figure it out how to do this. Could anyone land me a hand???
pacman:: p_load (ggplot2, VennDiagram, patchwork)
Venn Diagram Example:
myvd <- draw.quad.venn (area1 = 300, area3 = 70, area4 = 2, area2 = 1,
n12 = 0, n13 = 0, n14 = 0,
n23 = 0, n24 = 1, n34 = 1,
n123 = 0, n124 = 0, n134 = 0, n234 = 0, n1234 = 0,
category = c("A", "B", "C", "D"),
fill = c ("orange", "yellow", "pink", "lightblue"), lty = "blank")
Chart Example:
data <- data.frame(name=c("A","B","C","D","E"), value=c(3,12,5,18,45))
chart <- ggplot(data, aes(x=name, y=value)) + geom_bar(stat = "identity", width=0.2)
What it looks like:
But...!
I really needed to have this Venn Diagram's background removed, so it wouldn't overlap with the chart data... and I can't figure out how to do this =/