title: Quirk with geom_bar and ggplotly
body: <p>I came across what I think is a quirk with the <code>ggplotly</code> function in R's <code>plotly</code> package.</p>
  
  <p>When trying to wrap a <code>ggplot</code> plot (with <code>geom_bar</code> and <code>stat = identity</code>) inside the <code>ggplotly</code> function, negative values were coerced into positive values.</p>
  
  <p>The following is a toy example:</p>
  
  <pre><code>library(ggplot2)
  library(plotly)
  
  set.seed(12345)
  
  x &lt;- data.frame(
      x = 1:10,
      obs = floor(rnorm(10) * 100)
  )
  
  # x  obs
  # 1   58
  # 2   70
  # 3  -11
  # 4  -46
  # 5   60
  # 6 -182
  # 7   63
  # 8  -28
  # 9  -29
  # 10  -92
  
  test_plot &lt;- ggplot(x, aes(factor(x), obs)) + geom_bar(stat = "identity")
  test_plot
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/jXPNa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jXPNa.png" alt="enter image description here"></a></p>
  
  <pre><code>ggplotly(test_plot)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/c5qUO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c5qUO.png" alt="enter image description here"></a></p>
  
  <p>The values do not seem to be coerced when using other <code>geoms</code>. Am I missing something?</p>
  
  <p>Thanks for your help.</p>