Skip to content

Instantly share code, notes, and snippets.

#! /usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
data = np.loadtxt("vertical_data.txt")
## 表示例
# >>> vertical_data
# array([ 0., 1., 2., 3., 4., 5.])
#! /usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
vertical_data = np.loadtxt("vertical_data.txt")
## 表示例
# >>> vertical_data
# array([ 0., 1., 2., 3., 4., 5.])
@mkacky
mkacky / one_element_test_2.py
Created April 22, 2014 14:22
one element test 2
#! /usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
## 1要素の配列をテキストファイルから読み込み
a = np.loadtxt("one_element.txt", ndmin=1)
# 表示例
# >>> a
# array([ 10.])
@mkacky
mkacky / one_element_test_1.py
Last active August 29, 2015 14:00
one element test 1
#! /usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
## 1要素の配列をテキストファイルから読み込み
a = np.loadtxt("one_element.txt")
# 表示例
# >>> a
# array(10.0)
@mkacky
mkacky / one_element.txt
Last active August 29, 2015 14:00
one element
10
@mkacky
mkacky / legend_pos.py
Created September 28, 2013 08:57
test of legend position
#! /usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(-2*np.pi, 2*np.pi, 0.1)
plt.plot(x, np.sin(x), label='sin(x)')
plt.plot(x, np.cos(x), label='cos(x)')
@mkacky
mkacky / cast.py
Created August 18, 2013 10:18
test of cast
#! /usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
data = np.loadtxt("decimal.dat")
# 表示例
# >>> data
# array([ 12.4, 53.4, -2.6, 8.9, 11. ])
@mkacky
mkacky / testAnnotate.py
Last active December 20, 2015 07:59
sample of annotate()
#! /usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
# 全体のフォントサイズを設定
plt.rcParams.update({'font.size':15})