1

Is there a way to plot in R the following Venn diagram as squares rather then circles?

venn.plot <- draw.triple.venn(1883,598,2151,218,221,611,95, c("AL", "RL", "R"),scale=TRUE)
GSee
  • 48,880
  • 13
  • 125
  • 145
userJT
  • 11,486
  • 20
  • 77
  • 88
  • There doesn't seem to be a great ready made solution available, see: 1) http://stackoverflow.com/q/6009222/1317221 2) http://stackoverflow.com/q/1428946/1317221 – user1317221_G Dec 11 '12 at 20:07

1 Answers1

4

draw.triple.venn does return "...an object of class gList containing the grid objects that make up the diagram. Also displays the diagram in a graphical device unless specified with ind = FALSE. Grid::grid.draw can be used to draw the gList object in a graphical device." (from the VennDiagram help file), so with some creative editing of the components of that object you might be able to draw squares instead of circles.

(note: please delete the anonymous edit I accidentally wrote up) Here's the way to do it. Don't tell my boss I wasted time digging up this hack.

Rgames> hack.plot[[6]]$x<-unit(c(.25,.75,.75,.25),unit='npc')
Rgames> hack.plot[[6]]$y <-unit(c(.25,.25,.75,.75),unit='npc')

To get the square properly placed, those coordinates should have been range(as.numeric(hack.plot[[6]]$x)) and so on. I believe the three circles are in slots 6,7, and 8.

Carl Witthoft
  • 20,573
  • 9
  • 43
  • 73