I'm trying to get my figure to open with R, but it does not come up. Here is my standard code: venn.diagram( x = list( KP2 = c(2, 62, 22, 33, 11, 36, 26, 27, 28, 64, 5, 66, 10, 18, 68, 61, 6, 29, 19, 65, 30, 35, 32, 20, 69, 8, 31, 13, 21, 7), KP15 = c(2, 22, 39, 1, 14, 65, 67, 68, 1, 12, 23, 37, 4, 24, 25, 64, 52, 34, 9, 15, 13, 8, 16, 63, 3, 17), KP43 = c(39, 2, 49, 43, 51, 38, 56, 58, 60, 44, 54, 40, 50, 45, 57, 59, 46, 41, 47, 48, 42, 55, 53) ), filename = "location\\nifH_AA_alles.jpg" , col = "transparent", fill = c("red", "blue", "green"), alpha = 0.5, label.col = c("darkred", "white", "darkblue", "white", "white", "white", "darkgreen"), cex = 2.5, fontfamily = "serif", fontface = "bold", cat.default.pos = "text", cat.col = c("darkred", "darkblue", "darkgreen"), cat.cex = 2.5, cat.fontfamily = "serif", cat.dist = c(0.3, 0.4, 0.27), cat.pos = 0 ); This code saves the file to the desired location. However, I want the plot to open in the R interface, so I changed that line of the code to "filename=NULL". When I run the script afterwards, the plot does not open, instead, I get the following outputline: (polygon[GRID.polygon.1], polygon[GRID.polygon.2], polygon[GRID.polygon.3], polygon[GRID.polygon.4], polygon[GRID.polygon.5], polygon[GRID.polygon.6], text[GRID.text.7], text[GRID.text.8], text[GRID.text.9], text[GRID.text.10], text[GRID.text.11], text[GRID.text.12], text[GRID.text.13], text[GRID.text.14]) Could anyone help me adapt the code so I get the plot opened in R? Many thanks in advance, Guillaume -- View this message in context: http://r.789695.n4.nabble.com/Plot-does-not-show-in-R-tp4693637.html Sent from the R help mailing list archive at Nabble.com.
Hi, Try this, It works for me. venn.plot<-venn.diagram( x = list( KP2 = c(2, 62, 22, 33, 11, 36, 26, 27, 28, 64, 5, 66, 10, 18, 68, 61, 6, 29, 19, 65, 30, 35, 32, 20, 69, 8, 31, 13, 21, 7), KP15 = c(2, 22, 39, 1, 14, 65, 67, 68, 1, 12, 23, 37, 4, 24, 25, 64, 52, 34, 9, 15, 13, 8, 16, 63, 3, 17), KP43 = c(39, 2, 49, 43, 51, 38, 56, 58, 60, 44, 54, 40, 50, 45, 57, 59, 46, 41, 47, 48, 42, 55, 53) ), filename = NULL , col = "transparent", fill = c("red", "blue", "green"), alpha = 0.5, label.col = c("darkred", "white", "darkblue", "white", "white", "white", "darkgreen"), cex = 2.5, fontfamily = "serif", fontface = "bold", cat.default.pos = "text", cat.col = c("darkred", "darkblue", "darkgreen"), cat.cex = 2.5, cat.fontfamily = "serif", cat.dist = c(0.3, 0.4, 0.27), cat.pos = 0 ) grid.draw(venn.plot); 2014-07-07 17:42 GMT+02:00 gktahon <Guillaume.Tahon@ugent.be>:> I'm trying to get my figure to open with R, but it does not come up. > Here is my standard code: > > venn.diagram( > x = list( > KP2 = c(2, 62, 22, 33, 11, 36, 26, 27, 28, 64, 5, 66, 10, > 18, 68, 61, 6, > 29, 19, 65, 30, 35, 32, 20, 69, 8, 31, 13, 21, 7), > KP15 = c(2, 22, 39, 1, 14, 65, 67, 68, 1, 12, 23, 37, 4, > 24, 25, 64, 52, > 34, 9, 15, 13, 8, 16, 63, 3, 17), > KP43 = c(39, 2, 49, 43, 51, 38, 56, 58, 60, 44, 54, 40, > 50, 45, 57, 59, > 46, 41, 47, 48, 42, 55, 53) > ), > filename = "location\\nifH_AA_alles.jpg" , > col = "transparent", > fill = c("red", "blue", "green"), > alpha = 0.5, > label.col = c("darkred", "white", "darkblue", "white", "white", > "white", > "darkgreen"), > cex = 2.5, > fontfamily = "serif", > fontface = "bold", > cat.default.pos = "text", > cat.col = c("darkred", "darkblue", "darkgreen"), > cat.cex = 2.5, > cat.fontfamily = "serif", > cat.dist = c(0.3, 0.4, 0.27), > cat.pos = 0 > ); > > This code saves the file to the desired location. However, I want the plot > to open in the R interface, so I changed that line of the code to > "filename=NULL". When I run the script afterwards, the plot does not open, > instead, I get the following outputline: > > (polygon[GRID.polygon.1], polygon[GRID.polygon.2], polygon[GRID.polygon.3], > polygon[GRID.polygon.4], polygon[GRID.polygon.5], polygon[GRID.polygon.6], > text[GRID.text.7], text[GRID.text.8], text[GRID.text.9], > text[GRID.text.10], > text[GRID.text.11], text[GRID.text.12], text[GRID.text.13], > text[GRID.text.14]) > > > Could anyone help me adapt the code so I get the plot opened in R? > > Many thanks in advance, > Guillaume > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/Plot-does-not-show-in-R-tp4693637.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Un saludo Alfonso de Uña www.farmerdev.com [[alternative HTML version deleted]]
Hi, Are you using the vennDiagram package? It's very important to specify. If so, setting the argument filename=NULL then returns a grid object (as stated in the help file), which you can then plot or do whatever you wish with. A grid object is an R object that describes a plot, not the plot itself. http://stat.ethz.ch/R-manual/R-devel/library/grid/html/grid.grob.html http://stat.ethz.ch/R-manual/R-devel/library/grid/html/grid.draw.html Sarah On Mon, Jul 7, 2014 at 11:42 AM, gktahon <Guillaume.Tahon at ugent.be> wrote:> I'm trying to get my figure to open with R, but it does not come up. > Here is my standard code: > > venn.diagram( > x = list( > KP2 = c(2, 62, 22, 33, 11, 36, 26, 27, 28, 64, 5, 66, 10, 18, 68, 61, 6, > 29, 19, 65, 30, 35, 32, 20, 69, 8, 31, 13, 21, 7), > KP15 = c(2, 22, 39, 1, 14, 65, 67, 68, 1, 12, 23, 37, 4, 24, 25, 64, 52, > 34, 9, 15, 13, 8, 16, 63, 3, 17), > KP43 = c(39, 2, 49, 43, 51, 38, 56, 58, 60, 44, 54, 40, 50, 45, 57, 59, > 46, 41, 47, 48, 42, 55, 53) > ), > filename = "location\\nifH_AA_alles.jpg" , > col = "transparent", > fill = c("red", "blue", "green"), > alpha = 0.5, > label.col = c("darkred", "white", "darkblue", "white", "white", "white", > "darkgreen"), > cex = 2.5, > fontfamily = "serif", > fontface = "bold", > cat.default.pos = "text", > cat.col = c("darkred", "darkblue", "darkgreen"), > cat.cex = 2.5, > cat.fontfamily = "serif", > cat.dist = c(0.3, 0.4, 0.27), > cat.pos = 0 > ); > > This code saves the file to the desired location. However, I want the plot > to open in the R interface, so I changed that line of the code to > "filename=NULL". When I run the script afterwards, the plot does not open, > instead, I get the following outputline: > > (polygon[GRID.polygon.1], polygon[GRID.polygon.2], polygon[GRID.polygon.3], > polygon[GRID.polygon.4], polygon[GRID.polygon.5], polygon[GRID.polygon.6], > text[GRID.text.7], text[GRID.text.8], text[GRID.text.9], text[GRID.text.10], > text[GRID.text.11], text[GRID.text.12], text[GRID.text.13], > text[GRID.text.14]) > > > Could anyone help me adapt the code so I get the plot opened in R? > > Many thanks in advance, > Guillaume > >-- Sarah Goslee http://www.functionaldiversity.org
Works like a charm, thank you very much for your help! Logo_LM-UGent Guillaume Tahon (PhD Student) Ghent University, Faculty of Sciences Laboratory of Microbiology, K.L. Ledeganckstraat 35 B-9000 Gent T +32 (0)9 264 5134 F +32 (0)9 264 5092 E-mail: <mailto:Guillaume.Tahon@UGent.be> Guillaume.Tahon@UGent.be Web: www.lm.ugent.be Van: Alfonso de Uña [via R] [mailto:ml-node+s789695n4693646h94@n4.nabble.com] Verzonden: maandag 7 juli 2014 19:39 Aan: gktahon Onderwerp: Re: Plot does not show in R Hi, Try this, It works for me. venn.plot<-venn.diagram( x = list( KP2 = c(2, 62, 22, 33, 11, 36, 26, 27, 28, 64, 5, 66, 10, 18, 68, 61, 6, 29, 19, 65, 30, 35, 32, 20, 69, 8, 31, 13, 21, 7), KP15 = c(2, 22, 39, 1, 14, 65, 67, 68, 1, 12, 23, 37, 4, 24, 25, 64, 52, 34, 9, 15, 13, 8, 16, 63, 3, 17), KP43 = c(39, 2, 49, 43, 51, 38, 56, 58, 60, 44, 54, 40, 50, 45, 57, 59, 46, 41, 47, 48, 42, 55, 53) ), filename = NULL , col = "transparent", fill = c("red", "blue", "green"), alpha = 0.5, label.col = c("darkred", "white", "darkblue", "white", "white", "white", "darkgreen"), cex = 2.5, fontfamily = "serif", fontface = "bold", cat.default.pos = "text", cat.col = c("darkred", "darkblue", "darkgreen"), cat.cex = 2.5, cat.fontfamily = "serif", cat.dist = c(0.3, 0.4, 0.27), cat.pos = 0 ) grid.draw(venn.plot); 2014-07-07 17:42 GMT+02:00 gktahon <[hidden email]>:> I'm trying to get my figure to open with R, but it does not come up. > Here is my standard code: > > venn.diagram( > x = list( > KP2 = c(2, 62, 22, 33, 11, 36, 26, 27, 28, 64, 5, 66, 10, > 18, 68, 61, 6, > 29, 19, 65, 30, 35, 32, 20, 69, 8, 31, 13, 21, 7), > KP15 = c(2, 22, 39, 1, 14, 65, 67, 68, 1, 12, 23, 37, 4, > 24, 25, 64, 52, > 34, 9, 15, 13, 8, 16, 63, 3, 17), > KP43 = c(39, 2, 49, 43, 51, 38, 56, 58, 60, 44, 54, 40, > 50, 45, 57, 59, > 46, 41, 47, 48, 42, 55, 53) > ), > filename = "location\\nifH_AA_alles.jpg" , > col = "transparent", > fill = c("red", "blue", "green"), > alpha = 0.5, > label.col = c("darkred", "white", "darkblue", "white", "white", > "white", > "darkgreen"), > cex = 2.5, > fontfamily = "serif", > fontface = "bold", > cat.default.pos = "text", > cat.col = c("darkred", "darkblue", "darkgreen"), > cat.cex = 2.5, > cat.fontfamily = "serif", > cat.dist = c(0.3, 0.4, 0.27), > cat.pos = 0 > ); > > This code saves the file to the desired location. However, I want the plot > to open in the R interface, so I changed that line of the code to > "filename=NULL". When I run the script afterwards, the plot does not open, > instead, I get the following outputline: > > (polygon[GRID.polygon.1], polygon[GRID.polygon.2], polygon[GRID.polygon.3], > polygon[GRID.polygon.4], polygon[GRID.polygon.5], polygon[GRID.polygon.6], > text[GRID.text.7], text[GRID.text.8], text[GRID.text.9], > text[GRID.text.10], > text[GRID.text.11], text[GRID.text.12], text[GRID.text.13], > text[GRID.text.14]) > > > Could anyone help me adapt the code so I get the plot opened in R? > > Many thanks in advance, > Guillaume > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/Plot-does-not-show-in-R-tp4693637.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > [hidden email] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Un saludo Alfonso de Uña <http://www.farmerdev.com> www.farmerdev.com [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list <https://stat.ethz.ch/mailman/listinfo/r-help> https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide <http://www.R-project.org/posting-guide.html> http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. _____ If you reply to this email, your message will be added to the discussion below: http://r.789695.n4.nabble.com/Plot-does-not-show-in-R-tp4693637p4693646.html To unsubscribe from Plot does not show in R, click here <http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4693637&code=R3VpbGxhdW1lLlRhaG9uQFVHZW50LmJlfDQ2OTM2Mzd8MTI2MDc2MDk4Mw==> . <http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> NAML image001.png (12K) <http://r.789695.n4.nabble.com/attachment/4693669/0/image001.png> -- View this message in context: http://r.789695.n4.nabble.com/Plot-does-not-show-in-R-tp4693637p4693669.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]]