title: Plotly: how to specify symbol and color based on value?
body: <p>When plotting with <code>plotly</code> in R, how does one specify a color and a symbol based on a value? For example with the <code>mtcars</code> example dataset, how to plot as a red square if <code>mtcars$mpg</code> is greater or less than 18? </p>
  
  <p>For example:</p>
  
  <pre><code>library(plotly)
  
  
  p &lt;- plot_ly(type = "scatter", data = mtcars, x = rownames(mtcars), y = mtcars$mpg,
               mode = "markers" )
  </code></pre>
  
  <p>How to get all points above 20 as yellow squares?</p>