enable default cascade for template.coloraxis.colorscale in plotly express
未关闭
还没有人认领这个 Issue。
feature
P3
- 主要语言
- Python
- 星标
- 18.8k
- 派生
- 2.8k
- 平均合并
- 16 小时 26 分钟
- 30 天内合并 PR
- 21
描述
The official way of controlling the PX colorscale via templates is like this:
import plotly.express as px
import plotly.graph_objects as go
template = go.layout.Template()
template.layout.colorscale.sequential = px.colors.sequential.Blues
px.imshow([[1, 20, 30], [20, 1, 60], [30, 60, 1]], template=template)
But using the following will cause PX to use Viridis because we're providing a template without a default colorscale in the above location... This is pretty counter-intuitive and a relatively reasonable defaults cascade seems possible.
import plotly.express as px
import plotly.graph_objects as go
template = go.layout.Template()
template.layout.coloraxis.colorscale= px.colors.sequential.Blues
px.imshow([[1, 20, 30], [20, 1, 60], [30, 60, 1]], template=template)
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先重现 issue 中的两个 Plotly Express 示例,并比较生成的颜色刻度。跟踪 PX 如何应用 template.layout.colorscale.sequential 和 template.layout.coloraxis.colorscale,然后为预期的级联行为添加覆盖。完成标准是第二个示例使用所提供的 Blues 颜色刻度,而不是 Viridis。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- data-visualization
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100