Identical axis labels removed in heatmap (need new category mode or axis type)
See original GitHub issueConsider the following plot (as JSON):
{'layout': {u'margin': {u'r': 60, u'b': 60, u't': 60, u'l': 60}}, 'data': [{u'zmax': 1.0054633722786, u'colorscale': u'Viridis', u'zmin': -1.4410649905944, u'y': [u'a', u'b', u'a'], u'x': [u'd', u'd'], u'z': [[-0.50443826056116, -0.55385051210768], [-0.52712315391279, 1.0054633722786], [-1.4410649905944, 0.50761805140936]], u'type': u'heatmap'}]}
Note how there are identical axis labels in the JSON on the x and y-axis. This leads to an incorrect rendering:
It appears the identical labels get removed automatically.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:17 (6 by maintainers)
Top Results From Across the Web
Identical axis labels removed in heatmap (need new category mode ...
Identical axis labels removed in heatmap (need new category mode or axis type)
Read more >Change axis labels for seaborn heatmap - Stack Overflow
I have axis labels ABCDEFGHIJKLMNO and would like to change them to the labels 0.45 0.90 1.35 1.80 2.25 2.70 3.15 3.60 4.05...
Read more >How to include labels in sns heatmap
I got your problem like this way: You want to show labels on the x and y-axis on the seaborn heatmap. So for...
Read more >Change axis options | ThoughtSpot Software
Apply conditional formatting · Click the Conditional formatting option in the axis menu. Add conditional formatting · To specify a different color of...
Read more >Axes in R - Plotly
Set axis title text with Plotly. Axis titles are automatically set to the column names when using Plotly with a data frame as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Another workaround would be to use ticktext/tickvals:
http://codepen.io/cpsievert/pen/bqKJoe
Hey guys!
A little late to the party - however we’ve just run into this exact issue with the stacked-bar-chart. We are trying to display the properties of tools that are used in a process. Of course tools can be used multiple times.
Thanks to the solution of @cpsievert it works like a charm! (Thank you very much!).
Here’s a simple example where I just mixed the example code for stacked-bar-charts with the solution proposed by @cpsievert :
The reason why I’m posting this:
Would you kindly consider adding this information to the official documentation? (e.g. here)
As this issue shows it’s not an uncommon requirement and since there is a practical solution for this it would be great if it was described close to the charts themselves - maybe as an additional example (e.g. “bars with multiple occurrences of x-values”).
(Sorry if it’s already there and I just missed it!)