title: Horizontal/Vertical Line in plotly
body: <p>I'm using the <code>plotly</code> package and I'm trying to add a horizontal line to a graph. Is there any way of doing it using plotly?</p>
  
  <p>It can be done using <code>ggplot2</code> and the <code>ggplotly</code> function as shown below:</p>
  
  <pre><code>library(plotly)
  
  p &lt;- ggplot() +
    geom_hline(yintercept = 4) +
    xlim(c(0,10)) +
    ylim(c(0,10))
  
  ggplotly(p)
  </code></pre>
  
  <p>But I can't add this to an existing plotly plot.</p>
  
  <p>Also, the axis of my charts are not fixed, so it would be difficult (but not impossible) to just work out an x and y coordinate system for a horizontal line, but I'd rather just add one automatically.</p>
  
  <p>I've looked into the y0 and dy arguments, but I can't seem to get the code for those to work, either. I'm not quite sure what they do exactly, but I think they're maybe what I'm looking for? I can't find good examples of their usage.</p>