Skip to content

Instantly share code, notes, and snippets.

@musaprg
Created July 11, 2017 05:36
Show Gist options
  • Save musaprg/5a0525788b184768a211232ee8c860cc to your computer and use it in GitHub Desktop.
Save musaprg/5a0525788b184768a211232ee8c860cc to your computer and use it in GitHub Desktop.
Matplotlib Pyplotのアレコレ
#!/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()
@musaprg
Copy link
Author

musaprg commented Jul 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment