Skip to content

Instantly share code, notes, and snippets.

@le-dawg
Created February 8, 2020 22:44
Show Gist options
  • Save le-dawg/778321d7492a1a0415d6c1f9869d7c17 to your computer and use it in GitHub Desktop.
Save le-dawg/778321d7492a1a0415d6c1f9869d7c17 to your computer and use it in GitHub Desktop.
Fix for Pyplot/Matlplotlib heatmap clipping
# fix for mpl bug that cuts off/clips/clipping top/bottom of seaborn viz
b, t = plt.ylim() # discover the values for bottom and top
b += 0.5 # Add 0.5 to the bottom
t -= 0.5 # Subtract 0.5 from the top
plt.ylim(b, t) # update the ylim(bottom, top) values
plt.show() # ta-da!
# https://github.com/mwaskom/seaborn/issues/1773
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment