Hi A.K This is working layout(matrix(c(1,2,3,4), 4, 1, byrow = TRUE)) plot(sin, -pi, 10*pi) plot(sin, -pi, 20*pi) plot(sin, -pi, 30*pi) plot(sin, -pi, 40*pi) dev.off() but if I add this line png(filename = "fname.png", width = 900, height = 600, units = 'px') no plot is generated. where is the problem?. thanks veepsirtt> png(filename = "fname.png", width = 900, height = 600, units = 'px') > layout(matrix(c(1,2,3,4), 4, 1, byrow = TRUE)) > plot(sin, -pi, 10*pi) > plot(sin, -pi, 20*pi) > plot(sin, -pi, 30*pi) > plot(sin, -pi, 40*pi) > dev.off()null device 1> sessionInfo()R version 2.15.1 (2012-06-22) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_2.15.1>On Mon, Mar 18, 2013 at 6:36 PM, arun kirshna [via R] < ml-node+s789695n4661660h40@n4.nabble.com> wrote:> Hi, > > Couldn't reproduce your problem. > Using your code, I am getting the image below: > A.K. > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > http://r.789695.n4.nabble.com/plot-and-save-as-png-tp4661435p4661660.html > To unsubscribe from plot and save as png, click here<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4661435&code=dmVlcHNpcnR0QGdtYWlsLmNvbXw0NjYxNDM1fDY5NzkzMTE3Nw==> > . > NAML<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> >-- View this message in context: http://r.789695.n4.nabble.com/plot-and-save-as-png-tp4661435p4662114.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]]
Hi, So when you run the code suggested: png(filename = "fname.png", width = 900, height = 600, units = 'px') layout(matrix(c(1,2,3,4), 4, 1, byrow = TRUE)) plot(sin, -pi, 10*pi) plot(sin, -pi, 20*pi) plot(sin, -pi, 30*pi) plot(sin, -pi, 40*pi) dev.off() exactly like that, you do not get a file named fname.png in your working directory? Do you get an error message, or any other information from the R console? Sarah On Thu, Mar 21, 2013 at 1:55 PM, veepsirtt <veepsirtt at gmail.com> wrote:> Hi A.K > > This is working > layout(matrix(c(1,2,3,4), 4, 1, byrow = TRUE)) > plot(sin, -pi, 10*pi) > plot(sin, -pi, 20*pi) > plot(sin, -pi, 30*pi) > plot(sin, -pi, 40*pi) > dev.off() > but if I add this line > png(filename = "fname.png", width = 900, height = 600, units = 'px') > no plot is generated. > where is the problem?. > > thanks > veepsirtt > > > >> png(filename = "fname.png", width = 900, height = 600, units = 'px') >> layout(matrix(c(1,2,3,4), 4, 1, byrow = TRUE)) >> plot(sin, -pi, 10*pi) >> plot(sin, -pi, 20*pi) >> plot(sin, -pi, 30*pi) >> plot(sin, -pi, 40*pi) >> dev.off() > null device > 1 >> sessionInfo() > R version 2.15.1 (2012-06-22) > Platform: i386-pc-mingw32/i386 (32-bit) > > locale: > [1] LC_COLLATE=English_United States.1252 > [2] LC_CTYPE=English_United States.1252 > [3] LC_MONETARY=English_United States.1252 > [4] LC_NUMERIC=C > [5] LC_TIME=English_United States.1252 > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > loaded via a namespace (and not attached): > [1] tools_2.15.1 >> > > > On Mon, Mar 18, 2013 at 6:36 PM, arun kirshna [via R] < > ml-node+s789695n4661660h40 at n4.nabble.com> wrote: > >> Hi, >> >> Couldn't reproduce your problem. >> Using your code, I am getting the image below: >> A.K. >> > >-- Sarah Goslee http://www.functionaldiversity.org