title: Conditional formatting of plotly scatterplot markers
body: <p><strong>Problem:</strong><br>
  I have a data set with <code>x</code> and <code>y</code> value pairs, plus <code>lower_limit</code> and <code>upper_limit</code> values for <code>y</code>.</p>
  
  <p>I want to plot <code>x</code> vs. <code>y</code> in a plot.ly scatter plot, and <strong>colour the marker in green if <code>lower_limit</code> ≤ <code>y</code> ≤ <code>upper_limit</code>, else in red</strong>.</p>
  
  <p>I know that I could use 2 traces, or add a <code>color</code> column in the DataFrame. However, I'd like to generate these colour on the fly and use one trace only.</p>
  
  <p><strong>Example:</strong><br>
  Consider this data set:</p>
  
  <pre><code>   x   y  lower_limit  upper_limit
  0  1  13           10           15
  1  2  13           15           20
  2  3  17           15           20
  </code></pre>
  
  <p>The first marker (<code>x</code>=1, <code>y</code>=13) should be green, because <code>lower_limit</code> ≤ <code>y</code> ≤ <code>upper_limit</code> (10 ≤ 13 ≤ 15), just like the third one.<br>
  However the second should be red, because <code>y</code> &lt; <code>lower_limit</code>.</p>
  
  <p>I then want to produce this graph:
  <a href="https://i.stack.imgur.com/oPsxJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oPsxJ.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p><strong>MWE:</strong></p>
  
  <pre><code>import pandas as pd
  import plotly.graph_objs as go
  import plotly.plotly as py
  import plotly.offline as po
  
  data = [
      [1, 13, 10, 15],
      [2, 13, 15, 20],
      [3, 17, 15, 20]
  ]
  
  df = pd.DataFrame(
      data,
      columns=['x', 'y', 'lower_limit', 'upper_limit']
  )
  
  trace = go.Scatter(
      x=df['x'],
      y=df['y'],
      mode='markers',
      marker=dict(
          size=42,
          # I want the color to be green if 
          # lower_limit ≤ y ≤ upper_limit
          # else red
          color='green',
      )
  )
  
  po.plot([trace])
  </code></pre>