title: Plotly: How to plot rectangle with gradient color in Plotly?
body: <p>Can a shape such as a rectangle have a smooth color gradient in Plotly?</p>
  
  <p>I define the shape with a solid fill color as:</p>
  
  <pre><code>shapes=[dict(
      type='rect',
      xref='x',
      yref='paper',
      x0=box_from, x1=box_to,
      y0=0, y1=1,
      fillcolor='Green',
      opacity=0.07,
      layer='below',
      line=dict(width=0),
  )]
  </code></pre>
  
  <p>But I'd like the box not to have a solid color fill, but to have a smooth color gradient.</p>
  
  <ul>
  <li>This is the example in the documentation I'm following:<br/>
  <a href="https://plotly.com/python/shapes/#highlighting-time-series-regions-with-rectangle-shapes" rel="nofollow noreferrer">https://plotly.com/python/shapes/#highlighting-time-series-regions-with-rectangle-shapes</a></li>
  <li>The docs on <code>fillcolor</code> aren't very extensive:<br/>
  <a href="https://plotly.com/python/reference/#layout-shapes-items-shape-fillcolor" rel="nofollow noreferrer">https://plotly.com/python/reference/#layout-shapes-items-shape-fillcolor</a><br/></li>
  <li>I guess <code>colorscales</code> don't apply to shapes:<br/>
  <a href="https://plotly.com/python/builtin-colorscales/" rel="nofollow noreferrer">https://plotly.com/python/builtin-colorscales/</a></li>
  </ul>
  
  <p>My guess is the answer is a simple "not supported", but perhaps someone else knows better.</p>