Created
July 11, 2017 05:36
-
-
Save musaprg/5a0525788b184768a211232ee8c860cc to your computer and use it in GitHub Desktop.
Matplotlib Pyplotのアレコレ
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/env python3 | |
# -*- coding: utf-8 -*- | |
import numpy as np | |
import matplotlib.pyplot as plt | |
n = 100 | |
# x,yのデータ | |
x = np.arange(0, n, 1) | |
y = np.arange(0, n, 1) | |
# グラフの設定 | |
plt.title('HogeGraph $ax^{2}+bx+c$') #グラフタイトル。LaTeXも使えるよやったね | |
plt.xlabel("X-axis") #x軸ラベル名 | |
plt.ylabel("Y-axis") #y軸ラベル名 | |
plt.xlim([0,10]) #x軸の範囲を0<=x<=10に | |
plt.ylim([0,10]) #y軸の範囲を0<=x<=10に | |
#プロットやらなんやら(ここは適宜入れ替える) | |
plt.plot(x,y) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
参考:http://yubais.net/doc/matplotlib/modify.html