Calculate corner coordinates for each of the four rectangles in a square Venn diagram
CalcCorners(count)
a 4x4 matrix with columns "xleft", "xright", "ybottom", "ytop" (as
used by rect
) and rows "Ped1", "Ped2", "Mismatch", "Match".
a length 5 named vector: 'Total', 'Match', 'Mismatch', 'P1only', and 'P2only'.
the bottom-left corner of the Ped1 square is (0,0); offset is done
by VennSquares
. The size of the Ped1 and Ped2 squares is
proportional to their count, i.e. N1 = count["Total"] -
count["P2only"], and the length of each size thus proportional to the
sqrt
of that.
The x-location of the Ped2 square is a function of the amount of overlap (Match + Mismatch): if 0 coco["Ped1", "xright"], if 100 coco["Ped1", "xright"]; and proportional in-between these two extremes.
The overlap area between Ped1 and Ped2 is split into Mismatch (bottom) and Match (top).
PlotPedComp, VennSquares