title: Set font family and color in png plot device
body: <p>I'm plotting to a <code>png</code> device using <code>base</code> R. I want to force the font family to Calibri, with a specific shade of grey. I set the plot parameters in <code>par</code>.</p>
  <p>When I plot interactively in RStudio, everything works fine, but not when I save to <code>png</code>. What's wrong here?</p>
  <pre><code># set plot parameters
  myfont &lt;- 'Calibri'
  mycol &lt;- '#4B4B4D'
  par(family = myfont, fg = mycol, col = mycol, col.axis = mycol, col.lab = mycol, col.main = mycol, col.sub = mycol)
  
  # plot to default device works fine 
  plot(x = c(1:10), y = rep(1, 10)) 
  
  # export to png
  png('d:/working/example.png', units = &quot;in&quot;, width = 16, height = 9,
      pointsize = 12, res = 300, family = myfont)
  
  plot(x = c(1:10), y = rep(1, 10)) # nope, not myfont and not mycol
  dev.off()
  </code></pre>
  <p>Exporting manually via the RStudio plot window works, by the way, but that's not the way to go for me.</p>