Creates a blank 2D venn, searches the intersections and then draws them with the desired shaded areas in a ggplot based venn. The two circles are A and B, respectively. AB is the intersection, AnoB is the area of A not overlapping with B, and noAB is the area of B not overlappin with A. It is useful to inidcate that the data from a figure comes from an intersection.

shaded_2d_venn(
  highlight = c("AB", "AnoB", "noAB"),
  color = c("red", "pink", "blue"),
  label = NULL,
  label.pos = "bottom.right",
  label.face = "italic",
  label.size = 13,
  label.col = "black",
  line.col = "black"
)

Arguments

highlight

Character of length 1 to 3. One of c("AB", "AnoB", "noAB") or 'all'. If 'all', highlights all the areas. Default = c("AB", "AnoB", "noAB").

color

Character of length 1 to 3. The same length as highlight. Colors of the highlighted areas. Default = c("red", "pink", "blue").

label

Character of length 1 or NULL. Label to draw next to the Venn. If NULL, does not write any label. Default = NULL.

label.pos

Character of length 1. One of c("bottom.right", "right.bottom", "bottom.centre", "centre.bottom", "bottom.center", "center.bottom", "top.centre", "centre.top", "top.center", "center.top", "bottom.left", "left.bottom", "top.right", "right.top", "top.left", "left.top"). Position of the label if 'label' is not NULL. Default = 'bottom.right'

label.face

Character of length 1. Fontface of the label. Default = "italic"

label.size

Numeric of length 1. Size of the label. Default = 13

label.col

Character of length 1. Color of the label. Default = "black"

line.col

Character of length 1. Color of the line of the venn. Default = "black"

Author

amitjavilaventura