`plotly.graph_objects.Scatter` property `fillgradient` does not plot gradients with v5.22.0 in python
未关闭
还没有人认领这个 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
- plotly
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:
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 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