plotly / plotly/plotly.R

render ggplotly graphic - unable to start device

未关闭
#2,347 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
R
星标
2.7k
派生
641
PR 合并指标
30 天内没有已合并 PR

描述

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,

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

使用 ui.r 和 server.r 代码片段重现最小 Shiny 示例,重点关注 renderPlotly、ggplotly 和 stat_density_2d。检查报告中的 R 4.1.2 和 Ubuntu 22.04.4 环境以及 PNG 设备错误;确定原因且示例能够在没有该错误的情况下进行渲染后,该 issue 即得到解决。

由索引模型根据 Issue 内容生成。

评估

技术栈
r
领域
data-visualization
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。