plotly / plotly/plotly.py

`plotly.graph_objects.Scatter` property `fillgradient` does not plot gradients with v5.22.0 in python

未关闭
#4,649 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug P3
主要语言
Python
星标
18.8k
派生
2.8k
平均合并
16 小时 26 分钟
30 天内合并 PR
21

描述

Description

I am trying to use the fillgradient in a scatter plot with plotly.
I copied the documentation code for its use, but on code execution, the gradient does not appear.

Operating system & Environment
  • OS: macOS Sonoma 14.5
  • language: python 3.11.3
  • relevant libraries (working on VSCode in a jupyter notebook)
    • plotly 5.22.0
    • jupyterlab 3.6.3
    • ipywidgets 8.0.4
    • notebook 6.5.4
Code used
import plotly.graph_objects as go

fig = go.Figure(
    [
        go.Scatter(
            x=[1, 2, 3, 4],
            y=[3, 4, 8, 3],
            fill=None,
            mode="lines",
            line_color="darkblue",
        ),
        go.Scatter(
            x=[1, 2, 3, 4],
            y=[1, 6, 2, 6],
            fill="tonexty",
            mode="lines",
            line_color="darkblue",
            fillgradient=dict(
                type="horizontal",
                colorscale=[(0.0, "darkblue"), (0.5, "royalblue"), (1.0, "cyan")],
            ),
        ),
    ]
)

fig.show()

Output in picture:
image

贡献指南

打开贡献指南

从这里开始

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

调研方向

在列出的 Plotly 5.22.0 环境中,使用提供的 Python 示例在 Jupyter notebook 中重现该问题,从 fig.show() 和 Scatter fillgradient 配置开始。将渲染后的输出与文档中的渐变填充示例进行比较;当配置的渐变出现在散点填充中时,问题即告完成。

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

评估

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

把新 issue 发到你的邮箱

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