1

While running my script, I get the following error message during a code that creates a dozen plots in ggplot2 as part of an anlaysis:

Error in grid.Call.graphics(C_setviewport, vp, TRUE) : 
  non-finite location and/or size for viewport

The error message crashes the code. Interestingly, changing nothing and running the code again will resolve the problem, and it will work just fine. Sometimes, it will crash while creating a different plot.

I haven't been able to find any documentation on why this is happening.

There should be no error, and sometimes it works as expected.

r2evans
  • 141,215
  • 6
  • 77
  • 149
Eric
  • 11
  • 1
  • 1
    What version of R and ggplot are you using? Without some sort of [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) it's not going to be easy to give you any specific answer. – MrFlick Feb 06 '19 at 22:47
  • Me too. It seems to only happen while running unit tests and usually goes away after rerunning the code. I'm using R 3.5.2 and ggplot2 3.1.1 – Lisa DeBruine May 25 '19 at 08:44

0 Answers0