next up previous
Next: 4.1 四則演算のリストデータへの拡張 Up: ソフトウェア第三 講義資料 Lisp, リスト処理,集合 Previous: 3.4 C 曲線の表示


4 xlispstat

Luke Tierney がxlispを拡張し, 統計学などで利用される諸関数, グラフィックス表示用関数を備えたものである. xlisp-stat, lispstat, xlispstatなどで検索すると広く使われている ことがわかる.

ftp://ftp.stat.umn.edu/pub/xlispstat/3-52/
から,ソースプログラム 一式(xlispstat-3-52-19.tar.gz)を もってくることができる. Cygwinの環境でこれを作成するには,
% configure --with-gcc --x-includes=/usr/X11R6/include
% make
と行い,X11BSDstuff.cの最後のmemmove P3Cのところでエラーがでれば, この関数をコメントアウトし,ハードリンクを結ぶコマンドでエラーがでれば Makefileの中で,下のようにシンボリックリンクに直して,

xlisp: ${GRAPHSYS}xlisp
	-ln ${GRAPHSYS}xlisp.exe xlisp
もう一度makeし,最後に make installすれば /usr/local/lib/xlispstat以下に環境が作られる. これらの操作を行ったものは,
http://www.jsk.t.u-tokyo.ac.jp/
  ~inaba/lisp/xlispstat.tgz
からダウンロードし,展開してmakeすれば以下のように 利用できるようになる.

~/prog/lisp/xlisp/xlispstat/xlispstat-3-52-19> xlispstat
XLISP-PLUS version 3.04
Portions Copyright (c) 1988, by David Betz.
Modified by Thomas Almy and others.
XLISP-STAT Release 3.52.19 (Beta).
Copyright (c) 1989-1999, by Luke Tierney.

> (exit)
ドキュメントは
http://www.stat.uiowa.edu/~luke/
   xls/tutorial/techreport/techreport.html
にある. 以下は,xlispstat 2.1のバージョンの例で, このXLISP-PLUS version 3.04でも同じ関数を使うことが できる.ただ,手元のranduなどのXwindowをマウス操作する デモは操作が表示が少しうまくいかないところもあるようである.
ursa<inaba> xlispstat
XLISP version 2.1, Copyright (c) 1989, by David Betz
XLISP-STAT version 2.1 Release 2, Copyright (c) 1989,
   by Luke Tierney.
....
> (histogram '(1 2 2 3 1 2 3 4 1 2 3 4))
#<Object: 1618488, prototype = HISTOGRAM-PROTO>
>
このhistogramという関数は,ディスプレイ上にウィンドウを表示し,ヒスト グラムを棒グラフで示します.そのウィンドウには,Menuボタンなどがあり, それを用いるといろいろなことを指定できる.
図 7: ヒストグラムのウィンドウ
\includegraphics[width=7.0cm]{/home/inaba/eps/lecture/fig/histogram.eps}
Xlispstatに関しては,上にあげたニュースグループを参照するか,xlispstat について書かれた以下の書籍を参考にできる.
@book{XLispstat,
author = "Luke Tierney",
title = "Lisp-Stat: An Object-Oriented Environment for
        Statistical Computing and Dynamic Grapics",
publisher = "Wiley-Interscience",
year = 1990}
1376   xlisp2.1
78     xlisp.pc
20     makefiles
173    lsp/txt
110    lsp/comp
16     lsp/winston
250    lsp/back
283    lsp/eus
1358   lsp
1066   xlispstat/msdos
26     xlispstat/CL/CLS1.0A1/Data
2      xlispstat/CL/CLS1.0A1/Examples
228    xlispstat/CL/CLS1.0A1/lib
583    xlispstat/CL/CLS1.0A1
614    xlispstat/CL
26     xlispstat/xlispstat2.1R2/Data
41     xlispstat/xlispstat2.1R2/Examples
3      xlispstat/xlispstat2.1R2/machines/vax
3      xlispstat/xlispstat2.1R2/machines/sun3
7      xlispstat/xlispstat2.1R2/machines/pmax
3      xlispstat/xlispstat2.1R2/machines/generic
4      xlispstat/xlispstat2.1R2/machines/encore
3      xlispstat/xlispstat2.1R2/machines/sun4
7      xlispstat/xlispstat2.1R2/machines/ibmrt_bsd
2      xlispstat/xlispstat2.1R2/machines/decstation
2      xlispstat/xlispstat2.1R2/machines/next
36     xlispstat/xlispstat2.1R2/machines
335    xlispstat/xlispstat2.1R2/macintosh
9      xlispstat/xlispstat2.1R2/emacs
2527   xlispstat/xlispstat2.1R2
6      xlispstat/fixes
1041   xlispstat/mac
873    xlispstat/doc
627    xlispstat/xlispstat.doc/postscript
1095   xlispstat/xlispstat.doc
247    xlispstat/glim
7470   xlispstat
10303  xlisp
xlispstatのサンプルプログラムは /usr/local/lib/xlispstatの Examplesにある.
       9      24     308 abrasiondemo.lsp
      27     144    1206 addbox.lsp
      39     174    1361 addhandrotate.lsp
      50     206    1542 bcdemo.lsp
      94     398    3062 dataprotos.lsp
      10      47     295 fstat.lsp
     189     693    7448 inspect.lsp
     293    1268   11158 plotcontrols.lsp
      38     183    1274 regdemo.lsp
     130     502    4948 rotatedemo.lsp
      32     136    1260 tour.lsp
       8      27     255 tourdemo.lsp
     919    3802   34117 total
たとえば,
> (load
  "/usr/local/lib/xlispstat/Examples/rotatedemo.lsp")
; Loading ...
; "/usr/local/lib/xlispstat/Examples/rotatedemo.lsp"
; "/usr/local/lib/xlispstat/Examples/addbox.lsp"
; "/usr/local/lib/xlispstat/Examples/addhandrotate.lsp"
; "/usr/local/lib/xlispstat/Data/tutorial.lsp"
T
> (demo 'abrasion)
NIL
とすると,ウィンドウが表示され,
> (demo 'randu)
; loading "/usr/local/lib/xlispstat/Data/randu.lsp"
RANDU
>
とすると,そのウィンドウが次に示すようなウィンドウに置き換わる.
図 8: randuのウィンドウ
\includegraphics[width=7.0cm]{/home/inaba/eps/lecture/fig/randu.eps}
このウィンドウの右上のMenuボタンを右ボタンでクリックすると, 様々な設定が可能になります. また,下にある,Pitch,Roll,Yawのボタンを押し続けると三次元表示されている グラフが回転して表示される.



generated through LaTeX2HTML. M.Inaba 平成18年5月7日