Last active
May 6, 2020 13:01
-
-
Save metab0t/2f24f74323e24733954189dee8178093 to your computer and use it in GitHub Desktop.
[Snippets for matplotlib plotting] Here are some snippets I use with matplotlib #Python #matplotlib
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 | |
import matplotlib.pyplot as plt | |
import numpy as np | |
matplotlib.rcParams["font.family"] = "Sarasa Gothic SC" | |
plt.style.use("seaborn-poster") | |
fig, ax = plt.subplots(figsize=(15,7.5), facecolor="w", edgecolor="k") | |
fig.savefig("xx.png", dpi=300, bbox_inches="tight") |
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
#https://stackoverflow.com/a/10129461 | |
ax2 = ax.twinx() | |
lines, labels = ax.get_legend_handles_labels() | |
lines2, labels2 = ax2.get_legend_handles_labels() | |
ax.legend(lines + lines2, labels + labels2, loc=0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment