title: On shiny app ggplotly() renders half the size of plot_ly(). How to fix that?
body: <p>A plot's width is less than half when using ggplotly vs plot_ly to generate a plotly in a shiny app. Why is that? Is there a way to fix it so that ggplotly produces the plot with the same width as plot_ly or ggplot2? I have tried using the width parameter but that doesn't fix it.</p>
  
  <p>Output from the shiny app:
  <img src="https://i.stack.imgur.com/IIqAm.png" alt="Photo: output from the shiny app"></p>
  
  <pre><code>library(shiny)
  library(plotly)
  library(ggplot2)
  
  ui &lt;- fluidPage(
     titlePanel("plotly with shiny"),
        mainPanel(
          h4("Using ggplotly:"), plotlyOutput("ggplotly", width = "200"),
          h4("Using native plotly:"), plotlyOutput("plotly"),
          h4("Using ggplot:"), plotOutput("ggplot")
        )
  )
  
  server &lt;- function(input, output) {
    data &lt;- reactive({
      d = diamonds[sample(nrow(diamonds), 300),]
    }) 
    output$ggplot &lt;- renderPlot({
        ggplot(data(), aes(x=carat, y=price, color=price)) + geom_point()
     })
     output$ggplotly &lt;- renderPlotly({
       v = ggplot(data(), aes(x=carat, y=price, color=price)) + geom_point()
       ggplotly(v)
     })
     output$plotly &lt;- renderPlotly({
       plot_ly(data(), x = ~carat, y = ~price, color = ~price)
     })
  }
  
  shinyApp(ui = ui, server = server)
  </code></pre>