plotly / plotly/plotly.R

subplot() does not include titles from ggtitle()

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

还没有人认领这个 Issue。

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

描述

The following code does not include the text from ggtitle() in each subplot:

library(ggplot2)
library(plotly)

gg1 <- ggplot(data=iris) +
  geom_point(aes(x=Sepal.Length, y=Petal.Length)) +
  ggtitle("PLot 1")
gg2 <- ggplot(data=iris) +
  geom_point(aes(x=Sepal.Length, y=Petal.Width)) +
  ggtitle("PLot 2")

subplot(ggplotly(gg1), ggplotly(gg2), nrows=2)
sessionInfo()

R version 4.0.4 (2021-02-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Pop!_OS 21.04

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

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

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

other attached packages:
[1] plotly_4.10.1.9000 ggplot2_3.4.0     

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9        plyr_1.8.6        pillar_1.8.1      compiler_4.0.4    tools_4.0.4       digest_0.6.30     viridisLite_0.4.1 jsonlite_1.8.4    evaluate_0.17    
[10] lifecycle_1.0.3   tibble_3.1.8      gtable_0.3.1      pkgconfig_2.0.3   rlang_1.0.6       cli_3.4.1         DBI_1.1.1         rstudioapi_0.13   crosstalk_1.2.0  
[19] yaml_2.3.6        xfun_0.35         fastmap_1.1.0     withr_2.5.0       dplyr_1.0.10      httr_1.4.2        knitr_1.40        generics_0.1.3    vctrs_0.5.1      
[28] htmlwidgets_1.5.4 grid_4.0.4        tidyselect_1.2.0  glue_1.6.2        data.table_1.14.2 R6_2.5.1          fansi_1.0.3       rmarkdown_2.14    pander_0.6.5     
[37] tidyr_1.1.3       purrr_0.3.5       magrittr_2.0.3    scales_1.2.1      htmltools_0.5.3   assertthat_0.2.1  colorspace_2.0-3  labeling_0.4.2    utf8_1.2.2       
[46] lazyeval_0.2.2    munsell_0.5.0    

I get:

image

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先运行提供的 R 示例,使用 ggplot2 和 plotly,将 ggplotly(gg1) 和 ggplotly(gg2) 与 subplot() 的组合输出进行比较。检查 subplot() 和 ggplotly() 入口点,追踪 ggtitle() 文本的处理方式。当组合可视化中的每个 subplot 都显示其对应的标题时,即表示完成。

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

评估

技术栈
r
领域
data-visualization
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

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