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) |
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
# Add these lines after importing other modules | |
import matplotlib.pyplot as plt | |
%matplotlib inline | |
%config InlineBackend.figure_format='svg' | |
# Put all of your graph code in one cell | |
# The last line of the cell displays the graph. | |
plt.show | |
# reference https://matplotlib.org/faq/usage_faq.html#what-is-a-backend |