title: Setting size of the rgl device
body: <p>I have a problem with the fullscreen / non-fullscreen of my rgl device.</p>
  
  <p>Currently I use R 3.00</p>
  
  <p>I plot a persp3d plot (library rgl) into my device, it opens in a quite small window:</p>
  
  <p>The R code:</p>
  
  <pre><code>persp3d(x, y, z, theta=50, phi=25, expand=0.75, col=red,
          ticktype="detailed", xlab="", ylab="", zlab="",axes=FALSE)
  axes3d(c('x--','z'))
  
  axis3d(edge='y+-',at =c(1,500,1000,1500,2000,2320),
  labels =rownames(fd)[c(1,500,1000,1500,2000,2320)])
  </code></pre>
  
  <p>Which looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/XG3Ez.png" alt="sc"></p>
  
  <p>I now rotated it and saved the single png files to my drive. The problem is, that the png files are too small? I want to put them into one paper using LaTex and the <code>\animategraphics</code> command, but it is to pixely (not sharp).</p>
  
  <p>If I click on the fullscreen icon in the rgl device, so that the R plot is larger, this does help and everything works. The problem is, that there is too much white space around it. With this white space above, below, left and right to it I cannot include it in LaTex, because it does not fit because of its big size (width, height). I have 200 png files, so manually removing the white space with paint is not a nice work.</p>
  
  <p>The small pictures look like this:</p>
  
  <p><img src="https://i.stack.imgur.com/04Z7H.png" alt="sc11"></p>
  
  <p>The following happens, if you zoom in (this is, what LaTex does, when I put it into my paper, it increases the picture, screenshot is from my LaTex file. Same picture, a slightly different angle, but the problem stays the same):</p>
  
  <p><img src="https://i.stack.imgur.com/58e40.png" alt="sc22"></p>
  
  <p>You see that it looks pixely (not good). Also you can already see the problem with the large files with too much white space: The small picture with some white space above already destroys my title.</p>
  
  <p>So how could I solve this problem? How can I tell R to use the fullscreen plots but without so much white space around it? When I click on fullscreen and save those pictures everything is fine, except the white space around it.</p>
  
  <p>Here is the png file with too much white space around it (in this screenshot there is no white space below, but when I use the correct zoom it is there):</p>
  
  <p><img src="https://i.stack.imgur.com/ilOqB.png" alt="sc2"></p>
  
  <p>One further note: This is the R code I use to save the png- files:</p>
  
  <pre><code>M &lt;- par3d("userMatrix")
  movie3d( spin3d(rpm=3), duration=20,dir="C:/test/movie", clean=FALSE )
  play3d( spin3d(rpm=3), duration=20)
  </code></pre>