plotly / plotly/plotly.py

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

Open
#4,215 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided px.imshow example, changing Friday or Evening to a repeated label, and reproduce the missing row or column. Compare the behavior with go.Heatmap using the same data; done means repeated labels no longer silently hide data, or a clear error reports that they are unsupported.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.