title: Set default graphical parameters for device
body: <p>I often prefer to use a light text on dark background colortheme in IDEs. When I plot something in R the default colorscheme for plots is black text/borders/points on white background. I was trying to change this by default, preferably for specific devices called from R by default (<code>X11cairo</code>, <code>RStudioGD</code>), while keeping the normal defaults for 'output' devices such as <code>pdf</code> and <code>png</code>.</p>
  
  <p>My question is twofold: (1) How can I set default graphical parameters? and (2) Can I do this only for particular devices?</p>
  
  <p>For example, I can easilly set the colorscheme in the current device with <code>par</code>:</p>
  
  <pre><code>par(
    bg = "black",
    col = "white",
    col.axis = "white",
    col.lab = "white",
    col.main = "white",
    col.sub = "white")
  
  plot(1)
  </code></pre>
  
  <p>Creates the white on black plot as expected, and as expected resetting the device returns to defaults:</p>
  
  <pre><code>dev.off()
  plot(1)
  </code></pre>
  
  <p>I tried putting the following in my <code>.Rprofile</code>:</p>
  
  <pre><code>graphics:::par(
    bg = "black",
    col = "white",
    col.axis = "white",
    col.lab = "white",
    col.main = "white",
    col.sub = "white")
  graphics:::plot(1,type="n",xlab="",ylab="",axes=FALSE)
  graphics:::text(1,1,"Plotting area")
  </code></pre>
  
  <p>Which works somewhat, except that it opens a plot window on startup which can be abit annoying and in RStudio it doesn't open the RStudio device but an <code>x11</code> window. Also if I close that window the parameters reset again. I would prefer to be able to have this "colorscheme" used by default every time I open a plotting window with in for example RStudio's default device.</p>