Skip to content

Instantly share code, notes, and snippets.

@nagae
nagae / sin_plot.gpi
Created April 26, 2019 01:46
gnuplotのサンプル・スクリプト(sin関数とその近似)
f(x) = sin(x) # 正弦関数 g(x) = x - x**3/3! + x**5/5! # f(x)の近似
set xrange [-2*pi:2*pi]
set yrange [-1:1]
set title "正弦曲線とその近似" plot f(x), g(x)
set terminal pdfcairo
set output "sin_curve.pdf" replot
# x 軸の表示範囲を −2π ∼ 2π に
# y軸の表示範囲を −1∼1 に # グラフの表題
# f(x), g(x) を表示
# 出力ファイル名を指定
@nagae
nagae / Brewfile
Last active December 19, 2018 01:47
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
tap "homebrew/services"
cask "osxfuse"
brew "aspell"
brew "boost"
brew "eigen"
brew "encfs"
brew "ffmpeg"
@nagae
nagae / data.txt
Last active May 11, 2018 07:37
gnuplot を用いたデータのプロット
#month temperature precipitation
1 1.6 37.0
2 2.0 38.4
3 4.9 68.2
4 10.3 97.6
5 15.0 109.9
6 18.5 145.6
7 22.2 179.4
8 24.2 166.9
9 20.7 187.5
@nagae
nagae / zenkaku_error.tex
Created May 19, 2017 08:27
全角閉じ括弧でエラーになる例
\documentclass[12pt,a4paper]{jsarticle}
\begin{document}
\section{ほげほげ}% ほげほげの後の}が全角
ほげほげ
\end{document}
@nagae
nagae / population.dat
Last active May 27, 2016 06:27
県別人口
# 都道府県名 Pref. H17 H22 H23 H24 H25
北海道 Hokkaido 5628 5506 5486 5460 5431
青森県 Aomori-ken 1437 1373 1363 1350 1335
岩手県 Iwate-ken 1385 1330 1314 1303 1295
宮城県 Miyagi-ken 2360 2348 2327 2325 2328
秋田県 Akita-ken 1146 1086 1075 1063 1050
山形県 Yamagata-ken 1216 1169 1161 1152 1141
福島県 Fukushima-ken 2091 2029 1990 1962 1946
茨城県 Ibaraki-ken 2975 2970 2958 2943 2931
栃木県 Tochigi-ken 2017 2008 2000 1992 1986
@nagae
nagae / Sendai_574037_render.py
Created June 30, 2015 03:59
mapnik を使って地図の画像をレンダリングする
#! /usr/bin/python
# coding: UTF-8
import mapnik
mapfile = 'Sendai_574037_map.xml' # mapファイル名
map_output = 'Sendai_574037.png' # 出力ファイル名
# フォントのライブラリを指定
custom_fonts_dir = '/Library/Fonts/'
@nagae
nagae / Sendai_574037_map.xml
Last active August 29, 2015 14:23
mapnik 用mapファイル
<?xml version="1.0" encoding="utf-8"?>
<Map background-color="#f2efe9" srs="+proj=latlong +datum=WGS84">
<!-- フォント名を設定 -->
<FontSet name="book-fonts">
<Font face-name="Hiragino Kaku Gothic Pro W3" />
</FontSet>
<!-- highways という名前のスタイルを設定 -->
<Style name="highways">
<!-- 道路 -->
@nagae
nagae / data.txt
Last active April 19, 2016 09:09
Normal temperature and precipitation of Sendai city (from 1981 to 2010)
#month temperature precipitation
1 1.6 37.0
2 2.0 38.4
3 4.9 68.2
4 10.3 97.6
5 15.0 109.9
6 18.5 145.6
7 22.2 179.4
8 24.2 166.9
9 20.7 187.5
@nagae
nagae / deluxe_error.log
Last active August 29, 2015 14:19
luatexja-preset: deluxe option crashes
This is LuaTeX, Version beta-0.79.1 (TeX Live 2014) (rev 4971) (format=lualatex 2015.4.14) 15 APR 2015 11:01
\write18 enabled.
**deluxe_error
(./deluxe_error.tex
LaTeX2e <2014/05/01>
Babel <3.9l> and hyphenation patterns for 79 languages loaded.
(/usr/local/texlive/2014/texmf-dist/tex/luatex/luatexja/ltjsarticle.cls
Document Class: ltjsarticle 2014/12/24
(/usr/local/texlive/2014/texmf-dist/tex/luatex/luatexja/luatexja.sty
Package: luatexja 2013/05/14 Japanese Typesetting with LuaTeX
@nagae
nagae / barplot.py
Created March 24, 2015 08:35
bar plot with grids
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(5)
y = np.array([3,1,2,1,4])
plt.bar(x,y,linewidth=1.5,width=1,color='#16a085')
plt.ylim(0,4.5)
plt.xlim(-.5,5.5)
plt.xticks(range(6))
plt.yticks(range(5))
plt.axes().yaxis.grid()