plotly / plotly/plotly.py

heatmaps hide data if any X- or Y-axis label is repeated (px.imshow and go.Heatmap)

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

还没有人认领这个 Issue。

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

描述

This example is from Customizing the axes and labels on a heatmap:

import plotly.express as px
data=[[1, 25, 30, 50, 1], [20, 1, 60, 80, 30], [30, 60, 1, 5, 20]]
fig = px.imshow(data,
                labels=dict(x="Day of Week", y="Time of Day", color="Productivity"),
                x=['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
                y=['Morning', 'Afternoon', 'Evening'])
fig.show()

If you change "Friday" to "Monday", or "Evening" to "Morning", the row or column with the repeated label disappears. The same thing happens with go.Heatmap on the same page.

I don't think I read anywhere that labels must be unique, and all the examples suggest that the labels are arbitrary strings. If they must be unique, reporting an error seems more rational than hiding data.

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先运行提供的 px.imshow 示例,将 Friday 或 Evening 改为重复标签,并复现缺失的行或列。使用相同的数据将其行为与 go.Heatmap 进行比较;当重复标签不再静默地隐藏数据,或者明确的错误报告它们不受支持时,即可完成。

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

评估

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

把新 issue 发到你的邮箱

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