facet_wrap: middle row plotted differently from top and bottom facet rows
未关闭
还没有人认领这个 Issue。
- 主要语言
- R
- 星标
- 2.7k
- 派生
- 641
- PR 合并指标
- 30 天内没有已合并 PR
描述
You can see from the attached plot that the middle row of faceted plot is missing the "H" values (y-axis), since the facet labels for the bottom row are covering those "H" values (Note: I'm not showing all of the data in the plot; just what is relevant).
I cannot provide a full reprex, since the data is private, but my code for that chunk (quarto doc; Rstudio 2022.07.1):
p = annot %>%
mutate.(`plate row` = `plate row` %>%
reorder(`plate row` %>% as.factor %>% as.numeric %>% rev)) %>%
ggplot(aes(`plate column`, `plate row`,
text=`Species name`,
color=`Strain Viability`, size=`Strain Viability`)) +
geom_point() +
scale_x_continuous(breaks=1:12) +
scale_color_continuous(low='black', high='orange') +
scale_size_continuous(range = c(1,2)) +
facet_wrap(~ plate)
ggplotly(p, tooltip='text') %>%
layout(autosize = F, width = 800, height = 400)
sessionInfo:
R version 4.2.1 (2022-06-23)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.4
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices datasets utils methods base
other attached packages:
[1] gtsummary_1.6.1 skimr_2.1.4 plotly_4.10.0 tidytable_0.8.0
[5] data.table_1.14.2 ggplot2_3.3.6 dplyr_1.0.9
loaded via a namespace (and not attached):
[1] tidyselect_1.1.2 xfun_0.32 repr_1.1.4
[4] purrr_0.3.4 splines_4.2.1 lattice_0.20-45
[7] colorspace_2.0-3 vctrs_0.4.1 generics_0.1.3
[10] htmltools_0.5.3 viridisLite_0.4.0 yaml_2.3.5
[13] mgcv_1.8-40 base64enc_0.1-3 utf8_1.2.2
[16] rlang_1.0.4 pillar_1.8.0 glue_1.6.2
[19] withr_2.5.0 lifecycle_1.0.1 stringr_1.4.0
[22] commonmark_1.8.0 munsell_0.5.0 gtable_0.3.0
[25] htmlwidgets_1.5.4 forcats_0.5.1 labeling_0.4.2
[28] knitr_1.39 fastmap_1.1.0 crosstalk_1.2.0
[31] fansi_1.0.3 backports_1.4.1 checkmate_2.1.0
[34] renv_0.15.5 scales_1.2.0 jsonlite_1.8.0
[37] farver_2.1.1 digest_0.6.29 stringi_1.7.8
[40] grid_4.2.1 cli_3.3.0 tools_4.2.1
[43] sass_0.4.2 magrittr_2.0.3 lazyeval_0.2.2
[46] tibble_3.1.8 crayon_1.5.1 tidyr_1.2.0
[49] pkgconfig_2.0.3 ellipsis_0.3.2 broom.helpers_1.8.0
[52] Matrix_1.4-1 gt_0.6.0 httr_1.4.3
[55] R6_2.5.1 nlme_3.1-157 compiler_4.2.1
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从提供的 ggplotly(facet_wrap(...)) 示例开始,检查 facet 行和 y 轴标签的渲染方式。使用一个最小的公共数据集重现重叠问题;当中间行的“H”值保持可见且未被底部行的 facet 标签遮挡时,即完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- r
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100