Created
August 3, 2014 04:10
-
-
Save elfcobe/d9c4f6e8d12c525baa22 to your computer and use it in GitHub Desktop.
matplotlibでBackgroundに'agg'を設定しなくてはいけない場合
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
#!/usr/bin/python3 | |
# coding: utf-8 | |
import matplotlib | |
# Backend を agg に変更する | |
# matplatlib.pyplot を import する前に実行する | |
matplotlib.use('agg') | |
import matplotlib.pyplot as plt | |
def main_operating(): | |
plt.plot([1, 2, 3, 4], [1, 4, 9, 18]) | |
plt.ylabel('some numbers') | |
plt.show() | |
plt.savefig('test01.png') | |
if __name__ == '__main__': | |
main_operating() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment