title: What color does plot.xts use?
body: <p>Does anybody know what colours plot.xts uses? I can't find anything on the help page.
  I would like to use the same colours in my legend.</p>
  <p>Or is there another way to get the same plot with addLegend()?</p>
  <p>Here the code I am using:</p>
  <pre><code>library(xts)
  library(PerformanceAnalytics)
  library(TTR)
  
  xts1 &lt;- xts(matrix(rnorm(300), ncol = 3), order.by = as.Date(1:100))
  xts2 &lt;- xts(matrix(rnorm(300), ncol = 3), order.by = as.Date(1:100))
  colnames(xts1) &lt;- c(&quot;A&quot;, &quot;B&quot;, &quot;C&quot;)
  colnames(xts2) &lt;- c(&quot;A&quot;, &quot;B&quot;, &quot;C&quot;)
  
  plot_chart &lt;- function(x) {
    ff &lt;- tempfile()
    png(filename = ff)
    chart.CumReturns(x)
    dev.off()
    unlink(ff)
  }
  
  m &lt;- matrix(c(1, 2, 3, 3), nrow = 2, ncol = 2, byrow = TRUE)
  layout(mat = m, heights = c(0.8, 0.1))
  
  par(mar = c(2, 2, 1, 1))
  plot_chart(xts1)
  addSeries(reclass(apply(xts1, 2, runSD), xts1))
  
  par(mar = c(2, 2, 1, 1))
  plot_chart(xts2)
  addSeries(reclass(apply(xts2, 2, runSD), xts2))
  
  par(mar=c(0, 0, 1, 0))
  plot(1, type = &quot;n&quot;, axes = FALSE, xlab = &quot;&quot;, ylab = &quot;&quot;)
  
  # which colors do I have to insert in here?
  plot_colors &lt;- c(&quot;blue&quot;, &quot;green&quot;, &quot;pink&quot;)
  legend(x = &quot;top&quot;, inset = 0,
         legend = colnames(xts1), 
         col = plot_colors, lwd = 7, cex = .7, horiz = TRUE)
  </code></pre>