Heatmap: Specifying number of ticks or tick locations in cmap
See original GitHub issueFirst off, thanks so much @mwaskom for this great library. We use it constantly at my work place!
Q. I could not find an option to change the ticks locations (or the number of ticks) for the colormap in a heatmap. That is, I’m not talking about the x or y axis, but the ticks in the cmap itself.
Any suggestions on how to do it?
E.g. for:
# Draw the heatmap with the mask and correct aspect ratio
g = sns.heatmap(corr, mask=mask, cmap=cmap, vmax=1,
square=True, linewidths=.5, cbar_kws={"shrink": .9}, ax=ax)
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Seaborn heatmap, custom tick values - Stack Overflow
My solution is a little bit ugly but it works for me. Suppose your depth data is in depth_list and num_ticks is the...
Read more >seaborn.heatmap — seaborn 0.12.1 documentation
The value at which to center the colormap when plotting divergent data. Using this parameter will change the default cmap if none is...
Read more >All About Heatmaps - Towards Data Science
For numeric axis variables, If there are few bins, it is acceptable to keep tick marks on each bin. However, plotting tick marks...
Read more >How to control heatmap colorbar ticks? - HoloViz Discourse
I would like to have a heatmap which meets the following requirements: Specify limits and colors within the limits. Ticks on the colorbar ......
Read more >Colorbar Tick Labelling — Matplotlib 3.4.3 documentation
... vertical colorbar') # Add colorbar, make sure to specify tick locations to match desired ticklabels cbar = fig.colorbar(cax, ticks=[-1, ...
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 Free
Top 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

You can use the
tickscolorbar keyword argument (requires version 0.7.1+):I have the same issue as @andt88 : With a logarithmic norm, the “ticks” keyword gets ignored entirely. This is the code that produces my heatmap:
But in the result, the ticks of the color bar are shown logarithmically.