plotly / plotly/plotly.R

Individual marker styling inconsistent

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

还没有人认领这个 Issue。

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

描述

Hi, thank you for making and working on such a wonderful plotting package.

For one of the projects I'm working on, I'm trying to style individual markers, however it's inconsistent when trying to target individual markers. For example I want to make the fourth point as full opacity (1) and larger (15) while the others are at 0.2 and size 10. I would expect "sample4" to be at full opacity, but it's "sample3". Am I doing something wrong?

test_data <- data.frame(
    x_data = c(2.8113, 5.8112, 7.3461, 15.5405, 16.3035),
    y_data = c(2, 2, 2, 6, 3),
    groups = c("group1", "group1", "group2", "group2", "group1"),
    samples = c("sample1", "sample2", "sample3", "sample4", "sample5")
)
plotly::plot_ly(
    test_data,
    x = ~x_data,
    y = ~y_data,
    mode = "markers",
    type = "scatter",
    color = ~groups,
    text = ~samples,
    marker = list(
        size = c(10, 10, 10, 15, 10),
        opacity = c(0.2, 0.2, 0.2, 1, 0.2)
      )
    )

produces the following plot

image Thanks a lot in advance!

贡献指南

打开贡献指南

从这里开始

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

调研方向

在 plotly.R 仓库中重现所提供的 plot_ly 示例,并检查分组的 marker 向量如何映射到绘制出的点。将显示的 marker 样式与请求的 size 和 opacity 向量进行比较。当 sample4 获得 size 15 和 opacity 1,而其他样本获得 size 10 和 opacity 0.2 时,即表示完成。

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

评估

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

把新 issue 发到你的邮箱

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