Skip to content

Plotly Graph Download Size Issue #1556

Closed
@keeganmcbride

Description

@keeganmcbride

I am creating a Shiny app using Plotly and am seeing some weird behaviour when it comes to downloading/exporting the graph. The code below shows the gist of the app. What happens is, when clicking on the download image button it seems that the height/width don't accurately represent the values. However, if I simply press minimize/maximize on the browser window, the next time one downloads the image it fixes everything. I have also attached two images showing this behaviour.

Server.R

    p <- p +
      labs(x = "", y = ylabel, title = title2)  +    
      theme_minimal() 

    ggplotly(p, tooltip = "text") %>%
      layout(
        legend = list(
          orientation = "h",
          xanchor = "center",
          x = 0.5,
          y = -0.2
        ),
        title = list(font = list(size = 17.5)),
        annotations = list(x = 1, y = 1.05, text = "some text here",
                           showarrow = F, xref='paper', yref='paper', 
                           xanchor='right', yanchor='auto', xshift=0, yshift=0,
                           font=list(size=12, color="#b22f16"))
      ) %>%
      style(legendgroup = NULL) %>%
      config(displaylogo = FALSE,
             modeBarButtonsToRemove = list('lasso2d'))
UI.R
      fluidRow(
        plotlyOutput("output", height = 600) %>% withSpinner(color =
                                                                   "#003951", type = 4))

newplot - 2019-06-26T134118 324 <- Graph that one sees on the screen before minimizing/maximizing window.

newplot - 2019-06-26T134124 417 <- Graph that one sees on the screen after minimizing/maximizing window.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions