plotly / plotly/plotly.R

render ggplotly graphic - unable to start device

Open
#2,347 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
2.7k
Forks
641
PR merge metrics
No merged PRs in 30d

Description

Hello,

I try to plot dynamic graphs in a simple dashboard page, here a simple example:

ui.r part

library(shiny)
library(ggplot2)
library(plotly)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(title = "Basic dashboard"),
  dashboardSidebar(),
  dashboardBody(
    fluidRow(
	  plotlyOutput("plot3")
)
)
)

and server.r part

server <- function(input, output) { 
  output$plot3 <- renderPlotly({

  g <- ggplot(faithful, aes(x = eruptions, y = waiting)) +
  stat_density_2d(aes(fill = ..level..), geom = "polygon") + 
  xlim(1, 6) + ylim(40, 100)
  ggplotly(g)
  })
}

This app renders an error : unable to start PNG device.
Do you think is it a problem with my R session and versions of packages ?

R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.4 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so

locale:
[1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8
[4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8
[7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] maptiles_0.7.0 sf_1.0-8

loaded via a namespace (and not attached):
[1] Rcpp_1.0.10 magrittr_2.0.3 units_0.8-0 tidyselect_1.2.0
[5] R6_2.5.1 rlang_1.1.1 fansi_1.0.4 dplyr_1.1.2
[9] tools_4.1.2 grid_4.1.2 KernSmooth_2.23-20 utf8_1.2.3
[13] terra_1.6-17 cli_3.6.1 e1071_1.7-12 DBI_1.1.3
[17] class_7.3-20 tibble_3.2.1 lifecycle_1.0.3 codetools_0.2-18
[21] vctrs_0.6.3 glue_1.6.2 proxy_0.4-27 compiler_4.1.2
[25] pillar_1.9.0 generics_0.1.3 classInt_0.4-8 pkgconfig_2.0.3

Many thanks,

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the minimal Shiny example using the ui.r and server.r snippets, focusing on renderPlotly, ggplotly, and stat_density_2d. Check the reported R 4.1.2 and Ubuntu 22.04.4 environment and the PNG device error; the issue is resolved when the cause is identified and the example renders without that error.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.