0

I am trying to a simple plot with the below code

x<-c(1:10) y<-c(11:20) plot(x,y)

its showing up in Rstudio correct

Now i add the following 2 lines png(filename = "test.png")

plot(x,y)

Now, a file is created with the name given, but its empty. What could be wrong ? My OS is windows7

P.S. If I am doing pdf() instead of png, it is working.

  • 1
    Try adding the line `dev.off()` after your `plot` call. This closes the connection to the png and finalizes the writing. – Allan Cameron Apr 26 '22 at 11:29

0 Answers0