title: How to fill box plots with a user-defined color in R plotly?
body: <p>This question is obviously a replicate from this <a href="https://stackoverflow.com/questions/56879211/plotly-manual-fillcolor-for-boxplot#_=_">thread</a>.</p>
  <p>However I could not apply the solution given in the comments, hence my question.</p>
  <p>I want to use user-defined colors to fill box plots with plotly.</p>
  <p>In the following code I would expect the boxes to be filled respectively with red and blue, but they keep the default colors.</p>
  <pre><code>library(plotly)
  
  d1 &lt;- data.frame(val = rnorm(n=1000), type=1)
  d2 &lt;- data.frame(val = rnorm(n=1000), type=2)
  col1 &lt;- &quot;red&quot;
  col2 &lt;- &quot;blue&quot;
  
  plot_ly() %&gt;%
    add_trace(data = d1, y = ~val, type=&quot;box&quot;, colors=col1) %&gt;%
    add_trace(data = d2, y = ~val, type=&quot;box&quot;, colors=col2) 
  </code></pre>
  <p>I have managed to change the lines' and markers' colors, but not the fill.</p>