Last active
August 24, 2023 21:11
-
-
Save gillespilon/8025dffa18dfa63cd0e863e3e33a067e to your computer and use it in GitHub Desktop.
Remove the top and right spines of a matplotlib graph.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.axes as axes | |
def despine(ax: axes.Axes) -> None: | |
"Remove the top and right spines of a graph" | |
ax.spines[["top", "right"]].set_visible(b=False) | |
despine(ax=ax) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment