plotly / plotly/plotly.R

facet_wrap causing NA values

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

还没有人认领这个 Issue。

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

描述

The upper tile in the following example is changed by ggplotly. I assume it is grey because it is somehow NA. Only occurs when faceting is used.

test <- structure(list(week = c(7L, 7L, 32L), day = structure(c(5L, 6L, 
1L), .Label = c("Mon", "Tues", "Wed", "Thurs", "Fri", "Sat", 
"Sun"), class = c("ordered", "factor")), year = c(2017, 2017, 
2015), `Samples #` = c(31L, 49L, 20L)), class = c("tbl_df", "tbl", 
"data.frame"), row.names = c(NA, -3L), .Names = c("week", "day", 
"year", "Samples #"))

p <- ggplot(data = test, aes(x = day, y = week, fill = `Samples #`, height = 1)) +
geom_tile() +
facet_wrap(~year, ncol = 1) 

p

image

ggplotly(p)
image

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先运行提供的 R 复现代码,使用 ggplot、geom_tile、facet_wrap 和 ggplotly(p),然后将分面输出与原始图进行比较。使用分面时,如果上方的 tile 保持正确的值和外观,而不是变成灰色或 NA,则表示完成。

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

评估

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

把新 issue 发到你的邮箱

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