colors="" parameter cannot be used on multiple traces in one plot
未关闭
还没有人认领这个 Issue。
- 主要语言
- R
- 星标
- 2.7k
- 派生
- 641
- PR 合并指标
- 30 天内没有已合并 PR
描述
I have defined two vectors of colors (col1, col2) and I want to apply each color vector to two corresponding traces inside my plot using the colors parameter. But, Plotly ignores col2 and uses col1 for both traces.
col1 <- c("#e65353", "#62e653", "#53a4e6", "#53e6da", "#e6b053")
col2 <- c("#b72b7f", "#2ba5b7", "#3e8236", "#f87b60", "#000000")
iris %>%
plot_ly() %>%
add_trace(x = ~Sepal.Length, y = 0.3, color = ~Species, colors = col1) %>%
add_trace(x = ~Sepal.Width, y = 0.6, color = ~Species, colors = col2)

贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先运行使用 iris、plot_ly() 以及使用 col1 和 col2 的两个 add_trace() 调用的可复现 R 示例。跟踪 colors 参数在多个 trace 中的处理方式;当第二个 trace 使用 col2 而不是 col1 时完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- r
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100