boxplots are always placed below other geometries regardless of order
未关闭
还没有人认领这个 Issue。
- 主要语言
- R
- 星标
- 2.7k
- 派生
- 641
- PR 合并指标
- 30 天内没有已合并 PR
描述
Hi there
I noticed that with ggplotly() taking a ggplot object, the layering of geometries is not respected by boxplots, which always end up underneath everything else (in my testing at least).
See this reprex:
library(ggplot2)
bp <- ggplot(mpg, aes(x = class, y = hwy)) +
geom_jitter(colour = "orange") +
geom_boxplot()
# jitter is below boxplots
bp

# ggplotly puts boxplot underneath everything else
library(plotly)
#>
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#>
#> last_plot
#> The following object is masked from 'package:stats':
#>
#> filter
#> The following object is masked from 'package:graphics':
#>
#> layout
ggplotly(bp)
#> TypeError: Attempting to change the setter of an unconfigurable property.
#> TypeError: Attempting to change the setter of an unconfigurable property.

Created on 2020-08-19 by the reprex package (v0.3.0)
Interestingly, the TypeError doesn't show up in my console, but it does in the reprex output.
Using R 4.0.2 on Ubuntu 18.04 with RStudio 1.3.1073, ggplot2 3.3.2 and plotly 4.9.2.1
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,使用所述的 R、ggplot2 和 plotly 版本运行报告中的 ggplotly(bp) reprex,然后比较 ggplot 和渲染后的图层顺序。完成标准是箱线图遵循 geometry 顺序,并且报告的 TypeError 不再出现在 reprex 输出中。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- r
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100