I am creating a Shiny app with a plotly scatterplot. I am trying to keep the scatterplot square-shaped, but want a much larger size than its default. In the simple MWE below, fo
When you use ggplotly()
you can change the size of plotlyOutput
with layout options in the server part:
p2 <- ggplotly(p) %>% layout(height = 800, width = 800)
I found that plotlyOutput
will only work with parameters width = "600px", height = "600px"
if you provide input directly from plot_ly()
instead ggplotly()
, e.g.
p2 <- plot_ly(dat, x = ~x, y = ~y)