4.3 Customize Any Label

Venndir labels are customized using modify_venndir_overlap() as described in Modify Venn Overlaps. Some label adjustments are best illustrated with specific examples.

The recognized attributes are described in Overlap Attributes.

The overall font sizes used in a Venndir object are defined with argument font_cex when first calling venndir(), as described in Font Sizes. The font point sizes are stored in the Venndir object, and may be modified.

The most common adjustments involve the font size, color, and optional border and label fill.

The figures in Figure 4.4 show:

  • the default Venndir
  • customizations to one overlap count label
  • moving this overlap label outside the figure.
# default Venndir
v <- venndir(make_venn_test(do_signed=TRUE),
   main="Default Venndir")
# modified Venndir
v_mod <- modify_venndir_overlap(v,
   overlap_set="set_A&set_C",
   params=list(fill="royalblue",
      alpha=1,
      fontsize=c(20, 16, 12, 12, 12),
      label.border="navy",
      label.fill="royalblue3",
      label.color=c("white", "pink", "skyblue"),
      innerborder="royalblue4",
      innerborder.lwd=5))
plot(v_mod, main="Modified 'set_A&set_C'")
# move the label outside
v_mod1 <- modify_venndir_overlap(v_mod,
   overlap_set="set_A&set_C",
   params=list(label.count="outside"))
plot(v_mod1,main="Outside 'set_A&set_C'")
Venndir (left) and modified Venndir with customized label attributes (right), and how to move the label outside (bottom).Venndir (left) and modified Venndir with customized label attributes (right), and how to move the label outside (bottom).Venndir (left) and modified Venndir with customized label attributes (right), and how to move the label outside (bottom).

Figure 4.4: Venndir (left) and modified Venndir with customized label attributes (right), and how to move the label outside (bottom).

A short list of techniques follows:

  • To move the overlap count labels outside, set label.count='outside'.
  • To move the overlap count labels inside, set label.count='inside'.
  • To move an overlap Set label outside, set label.overlap='outside'.
  • To move an overlap Set label inside, set label.overlap='inside'.
  • To change label colors, define label.color for each label, in order.