Skip to content

Instantly share code, notes, and snippets.

var express = require('express');
const bodyParser = require('body-parser');
var jsg = require('json-schema-generator')
var http = require('http');
var async = require('async')
@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})
@mkacky
mkacky / testResizeAssign.cpp
Created July 15, 2013 02:27
sample of resize() and assign()
#include <iostream>
#include <vector>
using namespace std;
void dispVec(const vector<int>& vec)
{
cout << "===vecの中身===" << endl;
for(vector<int>::const_iterator it = vec.begin(); it != vec.end(); ++it)
{
@mkacky
mkacky / hist.py
Created July 13, 2013 16:37
sample of hist
#! /usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
## ファイルからデータを読み込み
data = np.loadtxt("hist.dat")
@mkacky
mkacky / sum.py
Created June 22, 2013 10:09
example of sum()
#! /usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
## 2x4の行列を作成
A = np.arange(8).reshape(2,4)
# >>> A
# array([[0, 1, 2, 3],
@mkacky
mkacky / resize.py
Created June 17, 2013 01:04
test of resize()
#! /usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
A = np.array([1,2,3])
# >>> A
# array([1, 2, 3])
@mkacky
mkacky / plotSci.py
Created June 9, 2013 04:42
Test of scientific notation
#! /usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
# 単純に大きな数字が2つならんだデータ
data = [980000, 500000]
plt.rcParams['ps.useafm'] = True
plt.rcParams['pdf.use14corefonts'] = True
plt.rcParams['text.usetex'] = True