情報処理概論Ⅰ 2007 第3回

情報処理概論Ⅰ 2007 第11回
2007/7/4
情報処理概論Ⅰ 第11回
1
前回の復習と今回の授業
 前回の授業
 LaTeX2e
 図の挿入
 今回の授業
 gnuplot
 データをプロットするツール
2007/7/4
情報処理概論Ⅰ 第11回
2
復習
図の挿入
¥begin{figure}
¥begin{center}
¥includegraphics[width=50mm]{lena.ps}
¥end{center}
lena.epsは.texファイルと同じ
¥caption{図の説明} ディレクトリに置いておく
¥end{figure}
図1:図の説明
2007/7/4
情報処理概論Ⅰ 第11回
3
gnuplotの起動
kaguals1%gnuplot
GNUPLOT
Send comments and requests for help to
<[email protected]>
Send bugs, suggestions and mods to
<[email protected]>
・
・
・
Terminal type set to 'x11‘
gnuplot> ■
※gnuplotは exit か quit コマンドで終了
2007/7/4
情報処理概論Ⅰ 第11回
4
f(x)=x
gnuplot> plot x
2007/7/4
情報処理概論Ⅰ 第11回
5
f(x)=sinx
gnuplot> plot sin(x)
2007/7/4
情報処理概論Ⅰ 第11回
6
範囲指定
gnuplot> plot [0:5] sin(x)
2007/7/4
情報処理概論Ⅰ 第11回
7
2つ以上のグラフ
gnuplot> plot x,x*x
2007/7/4
情報処理概論Ⅰ 第11回
8
使用できる関数
表1 gnuplotで使用できる主な関数
関数
sin(x)
cos(x)
tan(x)
log(X)
log10(x)
exp(x)
abs(x)
sqrt(x)
sinh(x)
cosh(x)
2007/7/4
内容
正弦関数(xの単位はラジアン)
余弦関数(xの単位はラジアン)
正接関数(xの単位はラジアン)
自然対数
常用対数
ex
xの絶対値
xの平方根
双曲正弦関数
双曲余弦関数
情報処理概論Ⅰ 第11回
9
オプション
表2 gnuplotで使用できる主なオプション
オプション
with points
with linespoints
with dots
with impulses
with steps
with boxes
2007/7/4
内容
大きめの点で出力
大き目の点及び線で出力
小さめの点で出力
x軸からの垂線で出力
階段状に出力
箱状に出力
情報処理概論Ⅰ 第11回
10
オプションを使用した例
gnuplot> plot x with linespoints
2007/7/4
情報処理概論Ⅰ 第11回
11
epsファイルへ出力
gnuplot> set terminal postscript eps
gnuplot> set output “x.eps”
gnuplot> plot x with line
Texへ挿入することができる
\begin{figure}
\begin{center}
\includegraphics{x.eps}
\end{center}
\caption{図の挿入}
\end{figure}
2007/7/4
情報処理概論Ⅰ 第11回
12
課題
 gnuplotにてepsで図を作成し、texに貼り付
けてください。また、グラフの数式をTexで記述
してください。
 関数を2つ以上、またオプションを使用し、ユ
ニークな作品作りに挑戦してください。
 必ず学籍番号,名前を1行目に書き,A4 サイ
ズ1枚で印刷してご提出下さい。
2007/7/4
情報処理概論Ⅰ 第11回
13
最終課題
 Texを使用し、A4サイズ2枚で自分の○○に
ついて説明してください。(○○は自由)
 今まで、習った機能を十分に活用すること。
 提出〆切は、7/11(水)の19:20で講義時間
中に集めます。
2007/7/4
情報処理概論Ⅰ 第11回
14