Created
July 24, 2016 21:11
-
-
Save jrhaberstroh/353fd1ab0cd5ca5bda6927690c396309 to your computer and use it in GitHub Desktop.
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
# START: SAFESAVEPLOT | |
if not args.o is None: | |
import matplotlib | |
matplotlib.use("agg") | |
import matplotlib.pyplot as plt | |
def safesaveplot(out=None, suffix=None, transparent=False, clf=True): | |
fig = plt.gcf() | |
if out: | |
plt.savefig(out+suffix, transparent=transparent) | |
if clf: | |
plt.clf() | |
else: | |
plt.show() | |
# END: SAFESAVEPLOT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment