question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"None-None" at bottom of a heatmap

See original GitHub issue

Heatmap places None-None at bottom and I have no idea how to get rid of it:

Versions:

  • python 2.7
  • seaborn - latest for 2.7

image

Code:

plt.figure(figsize=fig_size)
ax = plt.gca()
ax.set_title('Monthly returns, %', fontweight='bold')
heatmap(returns, xticklabels=[i[1] for i in list(returns.columns)], annot=True, fmt='0.3f', annot_kws={'size': 8}, alpha=1.0, center=0.0, cbar=False, cmap=cm.RdYlGn, ax=ax, robust=True)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mwaskomcommented, Mar 14, 2020

This is an xlabel, which is derived from the name(s) of the column index on your dataframe. Your transformations are producing a multiindex dataframe where none of the levels have names. No label is generated for an unnamed single index (because matplotlib ignores None) but that is not the case for multiindices. Your options are

  • Give your multiindex meanginful level names so that you get a meaningful x label
  • Rework your transformation so you do not end up with multiindex columns (I don’t think you want them here anyway)
  • Remove the x label after plotting with ax.set_xlabel(None).
0reactions
talaikiscommented, Mar 14, 2020

This is an xlabel, which is derived from the name(s) of the column index on your dataframe. Your

Yep, ax.set_xlabel('') effectively removes it. Thank you!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chapter 2 A Single Heatmap | ComplexHeatmap Complete ...
If it is set to "none" , the clustering is still applied but nothing in drawn on the heatmap body. The customized graphics...
Read more >
Heatmap in R: Static and Interactive Visualization - Datanovia
heatmap () [R base function, stats package]: Draws a simple heatmap ... R base heatmap: heatmap() ... Allowed values are in c(“row”, “column”,...
Read more >
heatmap: Draw a Heat Map - RDocumentation
A heat map is a false color image (basically image(t(x)) ) with a dendrogram ... and scaled in either the row direction or...
Read more >
Centering color key at bottom of heatmap - Stack Overflow
My aim is to generate a heatmap with no extra space between plot area and heatmap (excluding the key at the bottom). By...
Read more >
Draw a Heat Map - R
A heat map is a false color image (basically image(t(x)) ) with a dendrogram ... and scaled in either the row direction or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found