debian/0000755000000000000000000000000012261324420007162 5ustar debian/rules0000755000000000000000000000044312261304231010241 0ustar #!/usr/bin/make -f %: dh $@ --with ruby --buildsystem ruby override_dh_auto_build: dh_auto_build # ( cd doc && make ) override_dh_strip: dh_strip --dbg-package=ruby-pgplot-dbg override_dh_auto_clean: dh_auto_clean # ( cd doc && make clean ) [ ! -f rb_pgplot.c ] || rm -f rb_pgplot.c debian/copyright0000644000000000000000000000707112261304231011120 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: ruby-pgplot Source: http://pgplot.rubyforge.org/ Files: * Copyright: 2006 Masahiro TANAKA License: GPL-2+ or Ruby's Files: debian/* Copyright: 2011 Youhei SASAKI License: GPL-2+ License: Ruby's You can redistribute it and/or modify it under either the terms of the GPL (see COPYING.txt file), or the conditions below: . 1. You may make and give away verbatim copies of the source form of the software without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. . 2. You may modify your copy of the software in any way, provided that you do at least ONE of the following: . a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or by allowing the author to include your modifications in the software. . b) use the modified software only within your corporation or organization. . c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided. . d) make other distribution arrangements with the author. . 3. You may distribute the software in object code or executable form, provided that you do at least ONE of the following: . a) distribute the executables and library files of the software, together with instructions (in the manual page or equivalent) on where to get the original distribution. . b) accompany the distribution with the machine-readable source of the software. . c) give non-standard executables non-standard names, with instructions on where to get the original software distribution. . d) make other distribution arrangements with the author. . 4. You may modify and include the part of the software into any other software (possibly commercial). But some files in the distribution are not written by the author, so that they are not under this terms. . They are gc.c(partly), utils.c(partly), regex.[ch], st.[ch] and some files under the ./missing directory. See each file for the copying condition. . 5. The scripts and library files supplied as input to or produced as output from the software do not automatically fall under the copyright of the software, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this software. . 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. License: GPL-2+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License. . This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". debian/compat0000644000000000000000000000000212261304231010356 0ustar 7 debian/ruby-pgplot.docs0000644000000000000000000000010512261304231012312 0ustar debian/doc/*.html debian/doc/*.html.ja doc/*.css README.en README.ja debian/patches/0000755000000000000000000000000012261304231010607 5ustar debian/patches/series0000644000000000000000000000020312261304231012017 0ustar 0001-Update-extconf-and-Add-support-for-Ruby-1.9.2.patch 0002-Fix-mkdoc-for-Ruby-1.9.2.patch 0003-Update-Cogen-for-Ruby1.9.2.patch debian/patches/0003-Update-Cogen-for-Ruby1.9.2.patch0000644000000000000000000000230512261304231016556 0ustar From: Youhei SASAKI Date: Fri, 1 Jun 2012 18:57:48 +0900 Subject: Update Cogen for Ruby1.9.2 Signed-off-by: Youhei SASAKI --- cogen.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cogen.rb b/cogen.rb index 2494f5f..15c4174 100644 --- a/cogen.rb +++ b/cogen.rb @@ -120,6 +120,10 @@ def pgfuncgen(name, inp, out) retn = "rb_ary_new3(#{nout},"+retn.join(",")+")" end + unless retn.class == String + retn = retn.join(" ") + end + prot = prot.join(",") pass = pass.join(",") @@ -127,7 +131,7 @@ def pgfuncgen(name, inp, out) static VALUE rb_pgplot_#{name}(#{prot}) { - #{vars} + #{vars.join(" ")} c#{name}(#{pass}); return #{retn}; } @@ -143,8 +147,8 @@ def cogen_pgplot $pgfuncs.each{|x| fout.print pgfuncgen(*x)} elsif /--- auto-generated defs will be placed here ---/ =~ l $pgfuncs.each{|x| - n = x[1].split(",").size - fout.print " rb_define_module_function(mPgplot,\"#{x[0]}\",rb_pgplot_#{x[0]},#{n});\n"} + n = x[1].split(",").size + fout.print " rb_define_module_function(mPgplot,\"#{x[0]}\",rb_pgplot_#{x[0]},#{n});\n"} else fout.print end debian/patches/0002-Fix-mkdoc-for-Ruby-1.9.2.patch0000644000000000000000000005404312261304231016206 0ustar From: Youhei SASAKI Date: Fri, 1 Jun 2012 18:23:04 +0900 Subject: Fix mkdoc for Ruby 1.9.2 Signed-off-by: Youhei SASAKI --- doc/Makefile | 6 +-- doc/install.ja.rd | 126 ++++++++++++++++++++++++------------------------- doc/method.ja.rd | 124 ++++++++++++++++++++++++------------------------ doc/tutorial-01.ja.rd | 90 +++++++++++++++++------------------ 4 files changed, 173 insertions(+), 173 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 14d5770..14a8ed1 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,11 +1,11 @@ .SUFFIXES: .ja.rd .html.ja .rd .html .rb $(SUFFIXES) .ja.rd.html.ja: - rd2 -r rd2html-img-lib.rb --html-lang=ja --out-code=jis --with-css=css.css $< > $@ + ruby -I. /usr/bin/rd2 -r rd2html-img-lib.rb --html-lang=ja --out-code=jis --with-css=css.css $< > $@ .rd.html: - rd2 -r rd2html-img-lib.rb --with-css=css.css -o $* $< + ruby -I. /usr/bin/rd2 -r rd2html-img-lib.rb --with-css=css.css -o $* $< .rb.html: - rd2 -r rd2html-img-lib.rb --with-css=css.css -o $* $< + ruby -I. /usr/bin/rd2 -r rd2html-img-lib.rb --with-css=css.css -o $* $< targets_en=index.html \ pgline.html pgcont.html pgimag.html pghist.html \ diff --git a/doc/install.ja.rd b/doc/install.ja.rd index 0bc7480..2aa97af 100644 --- a/doc/install.ja.rd +++ b/doc/install.ja.rd @@ -1,105 +1,105 @@ =begin -= PGPLOTのインストール += PGPLOTゃ潟鴻若 -PGPLOTは configure を使わないのでインストールが若干面倒です。 -以下は Solaris、GCC という環境でPGPLOTをコンパイル、 -インストールする手順を説明します。 -他のOSでもUNIXならほとんど同じようにしてインストールできると思います。 -((<本家のインストール説明のページ|URL:http://www.astro.caltech.edu/~tjp/pgplot/install.html>)) -もご覧下さい。 +PGPLOT configure 篏帥сゃ潟鴻若ュ慌√с +篁ヤ SolarisGCC 医PGPLOT潟潟ゃ +ゃ潟鴻若茯障 +篁OSсUNIX祉ゃ潟鴻若с障 +((<絎吟ゃ潟鴻若茯若|URL:http://www.astro.caltech.edu/~tjp/pgplot/install.html>)) +荀т -=== PGPLOTのソースを用意 -(()) -から -((<ソースコード|URL:ftp://ftp.astro.caltech.edu/pub/pgplot/pgplot5.2.tar.gz>)) -をダウンロード、展開し、pgplotのディレクトリに移動します。 +=== PGPLOT純若鴻 +(()) + +((<純若鴻潟若|URL:ftp://ftp.astro.caltech.edu/pub/pgplot/pgplot5.2.tar.gz>)) +潟若絮pgplotc腱糸障 gunzip -c pgplot5.2.tar.gz | tar xvf - cd pgplot -=== 作業ディレクトリを作成 -作業ディレクトリを作ります。ここでは build という名前にします。 +=== 篏罐c篏 +篏罐c篏障с build 障 mkdir build cd build -=== drivers.listを編集 -PGPLOTで描画を出力するドライバを選択します。 -drivers.list というファイルをコピーしてエディタで開き、 -使いたいドライバの行の頭の ! の文字を削除します。 +=== drivers.list膩 +PGPLOTф祉阪ゃ御障 +drivers.list <ゃ潟若c帥ч +篏帥ゃ茵 ! 絖ゃ障 cp ../drivers.list . vi drivers.list -ドライバはお好みで選択できますが、UNIXなら +ゃ絅純帥ч御с障UNIX PNG, PPM, Postscipt, XWD, XWINDOW, XSERVE, XTERM -あたりを選んでおくのが一般的でしょう。 -PNG driverを組み込むには、 -(()) が必要です。 -他にもたくさんのドライバが含まれていますが、 -プリンタドライバの中にはコンパイルの時にエラーが出るものがあったり、 -GIFはライセンスに引っ掛かったりします。 - -=== makefile 作成 -次のコマンドで makefile を作成します。 +吾с筝с +PNG driver腟粋昭 +(()) 綽荀с +篁ゃ障障 +潟帥ゃ筝潟潟ゃ若冴c +GIFゃ祉潟鴻綣fc障 + +=== makefile 篏 +罨<潟潟 makefile 篏障 ../makemake .. sol2 g77_gcc -1番目の引数はソースのあるディレクトリの指定です。 -ここではソースディレクトリの下にいるので、((%..%)) を指定します。 -2番目の引数はOSの種類で、ソースディレクトリにある -((%sys_*%)) というディレクトリの中の ((%*%)) の部分を指定します。 -3番目の引数はコンパイラなどの設定で、sys_* の下にある -((%*.conf%)) というファイルの ((%*%)) の部分を指定します。 -もしこの中になければ、最も近そうなやつを選びます。 - -makefile を作成したら、ざっと見て設定が正しいかチェックします。 -ここで、PGPLOT ver 5.2.2 で PNG driverを使う場合、 -吐き出された makefile は、 +1綣違純若鴻c絎с +с純若鴻c筝с((%..%)) 絎障 +2綣違OS腮蕁с純若鴻c +((%sys_*%)) c筝 ((%*%)) 絎障 +3綣違潟潟ゃ荐絎сsys_* 筝 +((%*.conf%)) <ゃ ((%*%)) 絎障 +筝違菴ゃ吾潟障 + +makefile 篏c荀荐絎罩cс障 +сPGPLOT ver 5.2.2 PNG driver篏帥翫 +冴 makefile pndriv.o : ./png.h ./pngconf.h ./zlib.h ./zconf.h -というまずい設定になっているので、この行を削除します。 +障荐絎cс茵ゃ障 -=== コンパイル -makefile を編集したら、ライブラリをコンパイルします。 +=== 潟潟ゃ +makefile 膩ゃ潟潟ゃ障 make make cpg -=== インストール -make install が用意されていないので、手動でコピーします。 -必要なら root になってください。 -まずインストール先のディレクトリを環境変数にセットします。 -csh系なら、 +=== ゃ潟鴻若 +make install сс潟若障 +綽荀 root c +障ゃ潟鴻若c医紊違祉障 +csh膤祉 setenv PREFIX /usr/local setenv PGPLOT_DIR ${PREFIX}/pgplot -インストール先は自由に選べますが、 -コンパイル時にパス指定が必要になるかもしれません。 -次に必要なファイルをコピーします。 +ゃ潟鴻若宴吾鴻障 +潟潟ゃ号絎綽荀障 +罨<綽荀<ゃ潟若障 cp -p libpgplot.a libpgplot.so* libcpgplot.a ${PREFIX}/lib cp -p cpgplot.h ${PREFIX}/include mkdir ${PGPLOT_DIR} cp -p grfont.dat rgb.txt pgxwin_server ${PGPLOT_DIR} -これでインストール終了です。 +сゃ潟鴻若腟篋с -=== デモの実行 -コンパイルがうまくいったかどうかデモプログラムを走らせてみましょう。 -コンパイルしたディレクトリに pgdemo1 から pgdemo17 までと cpgdemo -という実行ファイルができているはずです。それらを実行できれば正しく -コンパイルされているはずです。 +=== ≪絎茵 +潟潟ゃ障c≪違莎違帥障 +潟潟ゃc pgdemo1 pgdemo17 障с cpgdemo +絎茵<ゃсс絎茵с井c +潟潟ゃс -=== ユーザ設定 -PGPLOTを使うユーザは、環境変数へ次の設定しておくとよいでしょう。 +=== 若区┃絎 +PGPLOT篏帥若吟医紊違御<荐絎с setenv PGPLOT_DIR /usr/local/pgplot setenv PGPLOT_DEV /xwin -PGPLOT_DIR は上でインストールしたディレクトリと同じ、 -PGPLOT_DEV はデフォルトのデバイスです。 -その他の環境変数は特に設定しなくてもいいと思いますが、詳しくは -((<ここ|URL:http://www.astro.caltech.edu/~tjp/pgplot/chapter1.html#ENV>)) -をご覧下さい。 +PGPLOT_DIR 筝сゃ潟鴻若c +PGPLOT_DEV ゃ鴻с +篁医紊違鴻荐絎障荅潟 +((<|URL:http://www.astro.caltech.edu/~tjp/pgplot/chapter1.html#ENV>)) +荀т <<< trailer diff --git a/doc/method.ja.rd b/doc/method.ja.rd index 161e563..46da15e 100644 --- a/doc/method.ja.rd +++ b/doc/method.ja.rd @@ -1,135 +1,135 @@ =begin = module Pgplot -== モジュールメソッド +== ≪吾ャ若<純 -=== 操作 +=== 篏 --- pgopen([device]) -PGPLOTセッションを開始する。戻り値としてステータスを返す。 +PGPLOT祉激с潟紮祉ゃ鴻若帥鴻菴 --- pgbeg([device, [nxsub, [nysub]]]) (obsolete) -PGPLOTセッションを開始する。戻り値としてステータスを返す。 +PGPLOT祉激с潟紮祉ゃ鴻若帥鴻菴 --- pgask( [true|false] ) --- pgenv( xmin,xmax,ymin,ymax [,just, axis] ) -=== 線・マーカの描画 +=== 膩祉若 --- pgline( xarray, yarray ) -xarray, yarray を結ぶ線を描く。 -xarray, yarray はそれぞれ X, Y 座標の配列。 +xarray, yarray 腟句 +xarray, yarray X, Y 綺ф --- pgpt( xarray, yarray [,symbol] ) -xarray, yarray の位置に、symbol のマーカを描く。 +xarray, yarray 篏臀symbol 若 --- pgpnts( xarray, yarray, symarray ) -xarray, yarray の位置に、対応する symarray のマーカをそれぞれ描く。 +xarray, yarray 篏臀絲上 symarray 若 -=== ヒストグラム +=== 鴻違 --- pgbin( xarray, yarray [,center] ) --- pghist( data, nbin [,range, flag] ) -=== エラーバー +=== 若 --- pgerrb( dir, x, y, err [,tlen] ) -エラーバーを描く。 -tlen に端点に描くバーの長さを指定。 -+ 片側エラーバー: +若若 +tlen 腴鴻若激絎 ++ 眼若: * dir = 1 for +X (X to X+err) * dir = 2 for +Y (Y to Y+err) * dir = 3 for -X (X to X-err) * dir = 4 for -Y (Y to Y-err) -+ 両側エラーバー: ++ 筝≦眼若: * dir = 5 for +/-X (X-err to X+err) * dir = 6 for +/-Y (Y-err to Y+err) --- pgerrx( x1, x2, y [,tlen] ) -x1 から x2 までを結ぶエラーバーを描く。 -tlen に端点に描くバーの長さを指定。 +x1 x2 障с腟吟若若 +tlen 腴鴻若激絎 --- pgerry( x, y1, y2 [,tlen] ) -y1 から y2 までを結ぶエラーバーを描く。 -tlen に端点に描くバーの長さを指定。 +y1 y2 障с腟吟若若 +tlen 腴鴻若激絎 -=== 等高線 +=== 膈蕭膩 --- pgcont( map, cont [,tr] ) -map で与えた2次元マップの等高線を描く。 -cont には等高線のレベルまたはその配列を与える。 +map т鐚罨≦膈蕭膩 +cont 膈蕭膩障筝 --- pgcons( map, cont [,tr] ) -PGCONTより速いアルゴルズムで描くんだそうな。 +PGCONT≪眼冴ф --- pgconb( map, cont [,blank, tr] ) -blankで与えた値を欠損値として等高線を描く。 +blankтゃ罨ゃ膈蕭膩 --- pgconf( map, cont_range [,tr] ) -cont_range に Rangeクラスオブジェクトで与えた範囲のレベルを塗り潰す。 +cont_range Range鴻吾ст膀蚊紂羹違 --- pgconl( map, cont, label [,intval, minint, tr] ) -等高線にラベルをつける。 +膈蕭膩ゃ -=== 画像 +=== 糸 --- pgimag( array [,range, tr] ) -カラースケールで array (2次元配列) の画像を描く。 +若鴻宴若 array (鐚罨≦) 糸 --- pgctab( l, r,g,b [,contra,bright] ) -pgimag で使用するカラーテーブルを設定する。 +pgimag т戎若若荐絎 --- pggray( array [,range, tr] ) -グレースケールで array (2次元配列) の画像を描く。 +違若鴻宴若 array (鐚罨≦) 糸 --- pgpixl( array [,x1,x2,y1,y2] ) -array (2次元配列) の画像を、長方形のpixel 1つ1つで描く。 +array (鐚罨≦) 糸傑劫就pixel 11ゃф --- pgvect( x, y [,scale, pos, tr, blank] ) -ベクトル場を描く。 +眼 -=== 座標軸の描画 +=== 綺ф荵吾 --- pgtick( x1, y1, x2, y2, v, [str], {"tickl", "tickr", "disp", "orient"} ) --- pgaxis( x1, y1, x2, y2, v1, v2, {"opt", "step", "nsub", "tickl", "tickr", "frac", "disp", "orient"} ) -=== カーソル入力 +=== 若純ュ --- pgcurs([x,y]) -クリックまたはキータイプのイベントを取得する。 -x,y を指定すると始めにその位置にカーソルを移動する。 -イベントを取得すると -カーソル位置(WC)と文字を PgCursorクラスのインスタンスで返す。 +障若帥ゃゃ潟緇 +x,y 絎紮篏臀若純腱糸 +ゃ潟緇 +若純篏臀(WC)絖 PgCursor鴻ゃ潟鴻帥潟鴻ц --- pgband( mode, [ xref, yref, [x, y, [posn]]]) -クリックまたはキータイプのイベントを取得する。 -x,y を指定すると始めにその位置にカーソルを移動する。 -xref, yref はアンカー点の位置(後述)で、省略すると現在位置となる。 -イベントを取得すると -カーソル位置(WC)と文字を PgCursorクラスのインスタンスで返す。 -modeによりカーソル入力中の描画方法を指定できる。 - * mode=0 : 描画なし。 - * mode=1 : アンカー点とカーソルを結ぶ線。 - * mode=2 : アンカー点とカーソルを対角とする長方形。 - * mode=3 : アンカー点とカーソル位置それぞれを通る2本の水平線。 - * mode=4 : アンカー点とカーソル位置それぞれを通る2本の垂直線。 - * mode=5 : カーソル位置を通る水平線。 - * mode=6 : カーソル位置を通る垂直線。 - * mode=7 : カーソル位置を通る十字線。 +障若帥ゃゃ潟緇 +x,y 絎紮篏臀若純腱糸 +xref, yref ≪潟主鴻篏臀(緇菴)сャ憜篏臀 +ゃ潟緇 +若純篏臀(WC)絖 PgCursor鴻ゃ潟鴻帥潟鴻ц +mode若純ュ筝紙号絎с + * mode=0 : 祉 + * mode=1 : ≪潟主鴻若純腟句 + * mode=2 : ≪潟主鴻若純絲乗傑劫就 + * mode=3 : ≪潟主鴻若純篏臀鐚羂翫抗膩 + * mode=4 : ≪潟主鴻若純篏臀鐚雁 + * mode=5 : 若純篏臀羂翫抗膩 + * mode=6 : 若純篏臀雁 + * mode=7 : 若純篏臀絖膩 --- pgolin( x, y, [sym, [npt]] ) -マウスカーソルで座標を連続して入力する。 -x,y にはあらかじめ NArray::SFLOAT 型の配列を与えておき、 -そこへクリックした順番に座標を記録していく。 -入力できる個数はこの配列のサイズで制限される。 -カーソルで入力した点は、マーカ sym で描画される。 -npt を指定すると、あらかじめ npt 個の点が入力されているとみなす。 -戻り値は入力した点の数。 +鴻若純у婚罔gュ +x,y NArray::SFLOAT 筝 +吾綺ф荐蚊 +ュс違泣ゃ冴у狗 +若純уュ鴻若 sym ф祉 +npt 絎 npt 鴻ュ帥 +祉ゃュ鴻違 --- pgncur( x, y, [sym, [npt]] ) -x,yに記録される順番が x の小さい順であることを除き、pgolin と同じ。 +x,y荐蚊 x 絨сゃpgolin --- pglcur( x, y, [npt] ) -入力した点を結ぶ線が描かれることを除いて、pgolin と同じ。 +ュ鴻腟句ゃpgolin -=== ステータスを返す +=== 鴻若帥鴻菴 --- pgqinf(item) value = pgqinf(item) diff --git a/doc/tutorial-01.ja.rd b/doc/tutorial-01.ja.rd index 4b0f112..7613c5e 100644 --- a/doc/tutorial-01.ja.rd +++ b/doc/tutorial-01.ja.rd @@ -1,72 +1,72 @@ =begin -= Ruby/PGPLOT 導入編 += Ruby/PGPLOT 絨ョ隈 -== 折れ線グラフを描く +== 膩違 -Ruby/PGPLOTで折れ線グラフを描く最小限のスクリプトは、以下のようになります。 +Ruby/PGPLOTф膩違絨鴻篁ヤ障 require 'narray' require 'pgplot' include Pgplot - pgopen # デバイスを開く - pgenv( 0, 5, 0, 5 ) # 枠の設定と描画 - pgline( [1,2,3,4], [1,4,1,4] ) # 折れ線の描画 + pgopen # ゃ鴻 + pgenv( 0, 5, 0, 5 ) # 荐絎 + pgline( [1,2,3,4], [1,4,1,4] ) # 膩 -以下このスクリプトについて詳しく説明します。 -1行目、2行目で拡張ライブラリをロードします。 +篁ヤ鴻ゃ荅潟顄障 +1茵2茵ф≦宍ゃ若障 -3行目では Pgplotモジュールをインクルードしています。 -これをしないと Pgplotのメソッドを呼ぶとき、``Pgplot.pgopen'' というように -モジュール名をメソッドの前に省略しないで書かなければなりません。 -インクルードするかどうかは場合によります。 -Pgplotモジュールのメソッド名は(今のところ)皆 ``pg'' で始まっているので、 -気をつければ名前がぶつかる確率は低いと思いますが、 -確実を期すならインクルードしない方がよいかもしれません。 +3茵с Pgplot≪吾ャ若ゃ潟若障 + Pgplot<純若吟``Pgplot.pgopen'' +≪吾ャ若<純ャф吾違障 +ゃ潟若翫障 +Pgplot≪吾ャ若<純(篁) ``pg'' у障cс +羂ゃ医吟ゃ腆榊篏障 +腆阪ゃ潟若鴻障 -4行目の pgopen で PGPLOT のグラフィクスデバイスを開きます。 -ここで引数を書かないと使用するデバイスを聞いてきます。 +4茵 pgopen PGPLOT 違c鴻ゃ鴻障 +у違吾篏睡ゃ鴻障 - Graphics device/type (? to see list, default /xwin): + Graphics device/type (? to see list, default /xwin): -デフォルトのままで良ければ単にリターンキーを押します。 -デフォルトのデバイスは環境変数 PGPLOT_DEV で設定したものになっています。 -`?'とリターンを打ち込むと、使用できるデバイスの一覧が表示されるので、 -その中から別のデバイスを選択することもできます。 -例えば、PNGとしてファイルに書き出したいときは、 -``plot1.png/png'' のように「ファイル名/デバイス名」というように指定します。 +障障ц医帥若潟若若障 +ゃ鴻医紊 PGPLOT_DEV ц┃絎c障 +`?'帥若潟∴昭篏睡сゃ鴻筝荀с茵腓冴с +筝ャゃ鴻御с障 +箴違PNG<ゃ吾冴 +``plot1.png/png'' <ゃ/ゃ劫絎障 -5行目の +5茵 pgenv( 0, 5, 0, 5 ) -により、グラフの軸を決定し、枠と目盛を描画します。 -引数は x-min, x-max, y-min, y-max の順です。 -ここではX軸が0から5、Y軸が0から5までの範囲の枠を描きます。 -以降はここで設定された座標をもとに描画します。 +違荵吾羆阪祉障 +綣違 x-min, x-max, y-min, y-max с +сX荵吾05Y荵吾05障с膀蚊障 +篁ラц┃絎綺ф祉障 -そしていよいよ、6行目の +6茵 pgline( [1,2,3,4], [1,4,1,4] ) -で、折れ線グラフを描きます。 -引数には線を結ぶ点のX座標とY座標をそれぞれ配列で渡します。 +с膩違障 +綣違膩腟句鴻X綺фY綺фф検障 -ここまで成功すれば、このようなグラフが描かれているはずです。 +障ф違違с <<< plot1.png -以上が折れ線グラフを描くのに最低限必要なメソッドです。 +篁ヤ膩違篏綽荀<純с -ところで、このスクリプトにはデバイスを閉じるメソッドがありません。 -CかFORTRAN版のPGPLOTであれば、 -ここで最後に pgend を呼んでデバイスを閉じる必要があります。 -そうしないと、デバイスが Postscript などのとき、 -終了処理がされないので、不完全なファイルができてしまいます。 -しかし Ruby/PGPLOTでは、Rubyインタプリタ終了時に -pgend を自動的に呼ぶようになっているので、 -必ずしも最後に pgend を呼ぶ必要はありません。 -ただしRubyの実行途中でPGPLOTを終了したいときのために -Ruby版でも pgend メソッドは用意してあります。 +с鴻ゃ鴻<純障 +CFORTRANPGPLOTс違 +ф緇 pgend 若сゃ鴻綽荀障 +ゃ鴻 Postscript +腟篋с筝絎<ゃс障障 + Ruby/PGPLOTсRubyゃ潟帥睡篋 +pgend 若吟cс +綽緇 pgend 若九荀障 +Ruby絎茵筝PGPLOT腟篋 +Rubyс pgend <純障 -以下続く(かもしれない) +篁ヤ膓() <<< trailer =end debian/patches/0001-Update-extconf-and-Add-support-for-Ruby-1.9.2.patch0000644000000000000000000002335612261304231022215 0ustar From: Youhei SASAKI Date: Fri, 1 Jun 2012 18:17:00 +0900 Subject: Update extconf and Add support for Ruby 1.9.2 --- cogen.rb | 2 +- extconf.rb | 4 ++-- kwarg.c | 23 +++++++++++++++++--- rb_pgplot.c.in | 65 +++++++++++++++++++++++++++++++++++--------------------- 4 files changed, 64 insertions(+), 30 deletions(-) diff --git a/cogen.rb b/cogen.rb index d5d526a..2494f5f 100644 --- a/cogen.rb +++ b/cogen.rb @@ -97,7 +97,7 @@ def pgfuncgen(name, inp, out) ninp = inp.size nout = out.size # int->0, float->1 - val2 = ["NUM2INT","NUM2DBL","STR2CSTR"] + val2 = ["NUM2INT","NUM2DBL","StringValuePtr"] type = ["int","float",nil] conv = ["INT2NUM","rb_float_new",nil] # Initialize Array diff --git a/extconf.rb b/extconf.rb index 3fabb54..39752c6 100644 --- a/extconf.rb +++ b/extconf.rb @@ -34,10 +34,10 @@ dir_config("pgplot") exit unless have_header("cpgplot.h") # Check NArray -$CPPFLAGS = " -I#{CONFIG['sitearchdir']} "+$CPPFLAGS +$CPPFLAGS = " -I#{CONFIG['vendorarchdir']} "+$CPPFLAGS exit unless have_header("narray.h") if RUBY_PLATFORM =~ /cygwin|mingw/ - $LDFLAGS = " -L#{CONFIG['sitearchdir']} "+$LDFLAGS + $LDFLAGS = " -L#{CONFIG['archdir']} "+$LDFLAGS exit unless have_library("narray","na_make_object") end diff --git a/kwarg.c b/kwarg.c index a03630c..0620ec2 100644 --- a/kwarg.c +++ b/kwarg.c @@ -9,6 +9,23 @@ NO WARRANTY. */ #include +#ifndef RUBY_19 +#ifndef RSTRING_PTR +#define RSTRING_PTR(a) (RSTRING(a)->ptr) +#endif +#ifndef RSTRING_LEN +#define RSTRING_LEN(a) (RSTRING(a)->len) +#endif +#ifndef RARRAY_PTR +#define RARRAY_PTR(s) (RARRAY(s)->ptr) +#endif +#ifndef RARRAY_LEN +#define RARRAY_LEN(s) (RARRAY(s)->len) +#endif +#ifndef StringValuePtr +#define StringValuePtr(s) STR2CSTR(s) +#endif +#endif /* void rb_scan_kw_args __((VALUE, ...)); */ @@ -18,7 +35,7 @@ kw_hash_i(i, tmp) { VALUE key; - key = RARRAY(i)->ptr[0]; + key = RARRAY_PTR(i)[0]; if (TYPE(key)==T_SYMBOL) { key = rb_funcall(key, rb_intern("id2name"), 0); } else @@ -26,7 +43,7 @@ kw_hash_i(i, tmp) rb_raise(rb_eArgError, "keywords must be String or Symbol"); } - rb_hash_aset(tmp, key, RARRAY(i)->ptr[1]); + rb_hash_aset(tmp, key, RARRAY_PTR(i)[1]); return Qnil; } @@ -71,7 +88,7 @@ rb_scan_kw_args(hash, va_alist) if (rb_funcall(tmp, rb_intern("empty?"), 0)==Qfalse) { val = rb_funcall(tmp, rb_intern("keys"), 0); val = rb_funcall(val, rb_intern("join"), 1, rb_str_new2(",")); - rb_raise(rb_eArgError, "unknown keywords: %s",STR2CSTR(val)); + rb_raise(rb_eArgError, "unknown keywords: %s",StringValuePtr(val)); } va_end(vargs); diff --git a/rb_pgplot.c.in b/rb_pgplot.c.in index f9a8cfe..ded737f 100644 --- a/rb_pgplot.c.in +++ b/rb_pgplot.c.in @@ -11,6 +11,23 @@ #include #include #include +#ifndef RUBY_19 +#ifndef RSTRING_PTR +#define RSTRING_PTR(a) (RSTRING(a)->ptr) +#endif +#ifndef RSTRING_LEN +#define RSTRING_LEN(a) (RSTRING(a)->len) +#endif +#ifndef RARRAY_PTR +#define RARRAY_PTR(s) (RARRAY(s)->ptr) +#endif +#ifndef RARRAY_LEN +#define RARRAY_LEN(s) (RARRAY(s)->len) +#endif +#ifndef StringValuePtr +#define StringValuePtr(s) STR2CSTR(s) +#endif +#endif #include "narray.h" #define min(a,b) (((a)<(b))?(a):(b)) @@ -89,7 +106,7 @@ static VALUE char *dev="?"; rb_scan_args(argc,argv, "01", &vdev); - if (vdev!=Qnil) dev = STR2CSTR(vdev); + if (vdev!=Qnil) dev = StringValuePtr(vdev); return INT2NUM(cpgopen(dev)); } @@ -104,7 +121,7 @@ static VALUE char *dev="?"; rb_scan_args(argc, argv, "03", &vdev,&vnxs,&vnys); - if (vdev!=Qnil) dev = STR2CSTR(vdev); + if (vdev!=Qnil) dev = StringValuePtr(vdev); if (vnxs!=Qnil) nxsub = NUM2INT(vnxs); if (vnys!=Qnil) nysub = NUM2INT(vnys); @@ -124,7 +141,7 @@ static VALUE just: if just=1, the x and y axes is scaled equally, otherwise scaled independently. axis: controls of axes. -*/ +*/ static VALUE rb_pgplot_pgenv( int argc, VALUE *argv, VALUE self ) { @@ -309,14 +326,14 @@ static void /* PGERRB -- horizontal or vertical error bar pgerrb, dir, x, y, err [,tlen] - dir : direction to plot the error bar relative to the data point. + dir : direction to plot the error bar relative to the data point. One-sided error bar: DIR is 1 for +X (X to X+E); 2 for +Y (Y to Y+E); 3 for -X (X to X-E); 4 for -Y (Y to Y-E). Two-sided error bar: - DIR is 5 for +/-X (X-E to X+E); + DIR is 5 for +/-X (X-E to X+E); 6 for +/-Y (Y-E to Y+E). x : world x-coordinates of the data. y : world y-coordinates of the data. @@ -500,9 +517,9 @@ static VALUE return Qtrue; } -/* PGCONL -- label contour map of a 2D data array +/* PGCONL -- label contour map of a 2D data array pgconl, map, cont, label [,intval, minint, tr] - map : 2-D array of map data + map : 2-D array of map data cont : contour level tobe labeld label : label string intval : spacing along the contour between labels, in grid cells. @@ -531,7 +548,7 @@ static VALUE /* Show Contour */ cpgconl( NA_PTR_FLT(na_map), NA_SHAPE0(na_map), NA_SHAPE1(na_map), 1, NA_SHAPE0(na_map), 1, NA_SHAPE1(na_map), - NUM2DBL(vcnt), tr, STR2CSTR(vlab), intval, minint); + NUM2DBL(vcnt), tr, StringValuePtr(vlab), intval, minint); return Qtrue; } @@ -624,7 +641,7 @@ static VALUE else cpggray( NA_PTR_FLT(na), NA_SHAPE0(na), NA_SHAPE1(na), 1, NA_SHAPE0(na), 1, NA_SHAPE1(na), - range[0], range[1], tr ); + range[0], range[1], tr ); return Qtrue; } @@ -774,7 +791,7 @@ static VALUE int value_len=20; char *item, *value; - item = STR2CSTR(vitem); + item = StringValuePtr(vitem); value = ALLOCA_N(char,value_len); cpgqinf( item, value, &value_len ); @@ -819,7 +836,7 @@ static VALUE VALUE vx,vy; int i; float xbox[4], ybox[4]; - char *txt = STR2CSTR(text); + char *txt = StringValuePtr(text); cpgqtxt( NUM2DBL(x),NUM2DBL(y),NUM2DBL(ang),NUM2DBL(fjust),txt, xbox, ybox ); @@ -979,7 +996,7 @@ static VALUE if (NA_TYPE(x)!=NA_SFLOAT || NA_TYPE(y)!=NA_SFLOAT) rb_raise(rb_eArgError, "Array must NArray.sfloat"); - cpgolin( min(NA_TOTAL(x),NA_TOTAL(y)), &npt, + cpgolin( min(NA_TOTAL(x),NA_TOTAL(y)), &npt, NA_PTR_FLT(x), NA_PTR_FLT(y), sym ); return INT2NUM(npt); @@ -1009,7 +1026,7 @@ static VALUE if (NA_TYPE(x)!=NA_SFLOAT || NA_TYPE(y)!=NA_SFLOAT) rb_raise(rb_eArgError, "Array must NArray.sfloat"); - cpgncur( min(NA_TOTAL(x),NA_TOTAL(y)), &npt, + cpgncur( min(NA_TOTAL(x),NA_TOTAL(y)), &npt, NA_PTR_FLT(x), NA_PTR_FLT(y), sym ); return INT2NUM(npt); @@ -1037,7 +1054,7 @@ static VALUE if (NA_TYPE(x)!=NA_SFLOAT || NA_TYPE(y)!=NA_SFLOAT) rb_raise(rb_eArgError, "Array must NArray.sfloat"); - cpglcur( min(NA_TOTAL(x),NA_TOTAL(y)), &npt, + cpglcur( min(NA_TOTAL(x),NA_TOTAL(y)), &npt, NA_PTR_FLT(x), NA_PTR_FLT(y) ); return INT2NUM(npt); @@ -1058,7 +1075,7 @@ void rb_scan_kw_args __((VALUE, ...)); baseline parallel to the axis and reading in the same direction as the axis (from point 1 to point 2). Current line and text attributes are used. - + Arguments: X1, Y1 : world coordinates of one endpoint of the axis. X2, Y2 : world coordinates of the other endpoint of the axis. @@ -1095,7 +1112,7 @@ static VALUE if (tickr ==Qnil) tickr = INT2FIX(0); if (disp ==Qnil) disp = INT2FIX(1); if (orient==Qnil) orient= INT2FIX(0); - if (vstr !=Qnil) str = STR2CSTR(vstr); + if (vstr !=Qnil) str = StringValuePtr(vstr); cpgtick( NUM2DBL(x1),NUM2DBL(y1),NUM2DBL(x2),NUM2DBL(y2), NUM2DBL(v), NUM2DBL(tickl),NUM2DBL(tickr), @@ -1114,25 +1131,25 @@ static VALUE Draw a labelled graph axis from world-coordinate position (X1,Y1) to (X2,Y2). - + Normally, this routine draws a standard LINEAR axis with equal subdivisions. The quantity described by the axis runs from V1 to V2; - this may be, but need not be, the same as X or Y. - + this may be, but need not be, the same as X or Y. + If the 'L' option is specified, the routine draws a LOGARITHMIC axis. In this case, the quantity described by the axis runs from 10**V1 to - 10**V2. A logarithmic axis always has major, labeled, tick marks + 10**V2. A logarithmic axis always has major, labeled, tick marks spaced by one or more decades. If the major tick marks are spaced by one decade (as specified by the STEP argument), then minor tick marks are placed at 2, 3, .., 9 times each power of 10; otherwise minor tick marks are spaced by one decade. If the axis spans less than two decades, numeric labels are placed at 1, 2, and 5 times each power of ten. - + If the axis spans less than one decade, or if it spans many decades, it is preferable to use a linear axis labeled with the logarithm of the quantity of interest. - + Arguments: x1, y1 : world coordinates of one endpoint of the axis. x2, y2 : world coordinates of the other endpoint of the axis. @@ -1180,7 +1197,7 @@ static VALUE if (argc>0 && TYPE(argv[argc-1]) == T_HASH) val = argv[--argc]; - rb_scan_kw_args( val, + rb_scan_kw_args( val, "opt",&vopt, "step",&step, "nsub",&nsub, "tickl",&tickl, "tickr",&tickr, "frac",&vfrac, "disp",&disp, "orient",&orient, 0); @@ -1192,7 +1209,7 @@ static VALUE if (tickr ==Qnil) tickr = INT2FIX(0); if (disp ==Qnil) disp = INT2FIX(1); if (orient==Qnil) orient= INT2FIX(0); - if (vopt !=Qnil) opt = STR2CSTR(vopt); + if (vopt !=Qnil) opt = StringValuePtr(vopt); if (vfrac !=Qnil) frac = NUM2DBL(vfrac); cpgaxis( opt, NUM2DBL(x1),NUM2DBL(y1),NUM2DBL(x2),NUM2DBL(y2), debian/ruby-pgplot.examples0000644000000000000000000000000712261304231013201 0ustar test/* debian/changelog0000644000000000000000000000401112261305036011032 0ustar ruby-pgplot (0.1.3-8) unstable; urgency=low * Team upload * Update for ruby1.8-removal * Bump standards version to 3.9.5 * Update gem2deb depends to 0.6.1~ [ C辿dric Boutillier ] * remove obsolete DM-Upload-Allowed flag * use DEP5 copyright-format/1.0 official URL for Format field -- Praveen Arimbrathodiyil Thu, 02 Jan 2014 21:12:44 +0530 ruby-pgplot (0.1.3-7) unstable; urgency=low [ David Pr辿vot ] * Fix Vcs- entries (Closes: #691899) [ Youhei SASAKI ] * Update debian/changelog, Thanks to David Pr辿vot!! -- Youhei SASAKI Sat, 24 Nov 2012 16:21:38 +0900 ruby-pgplot (0.1.3-6) unstable; urgency=low * Fix FTBFS: Add gfortran-4.6 into Build-Depends (Ruby1.8 is build by gcc-4.6) Thanks to Micah Gersten! (Closes: #685963) * Add libpng12-dev, libx11-dev into Build-Depends for better user support -- Youhei SASAKI Sun, 02 Sep 2012 04:59:44 +0900 ruby-pgplot (0.1.3-5) unstable; urgency=low * Fix FTBFS: workaround for RD2 Bugs Thanks to Andreas Beckmann! (Closes: #682409) -- Youhei SASAKI Wed, 25 Jul 2012 14:43:08 +0900 ruby-pgplot (0.1.3-4) unstable; urgency=low * Fix typo, Thanks to Vincent Blut (Closes: #675471) -- Youhei SASAKI Sat, 02 Jun 2012 14:38:19 +0900 ruby-pgplot (0.1.3-3) unstable; urgency=low * Bump Standard version: 3.9.3 * Fix FTBFS, Thanks to Samuel Thibault! (Closes: #675390) * Change patch handling: Use gbp-pq * Update debian/copyright for format 1.0 * Remove unneeded REAMDE.source -- Youhei SASAKI Fri, 01 Jun 2012 19:09:17 +0900 ruby-pgplot (0.1.3-2) unstable; urgency=low * Team upload. * debian/control: + fix typo: Ruby-Version -> Ruby-Versions -- Lucas Nussbaum Sat, 18 Jun 2011 11:14:56 +0200 ruby-pgplot (0.1.3-1) unstable; urgency=low * Initial release (Closes: #626097) -- Youhei SASAKI Tue, 14 Jun 2011 21:44:13 +0200 debian/control0000644000000000000000000000317112261317111010566 0ustar Source: ruby-pgplot Section: contrib/ruby Priority: optional Maintainer: Youhei SASAKI Uploaders: Debian Ruby Extras Maintainers Build-Depends: debhelper (>= 7.0.50~), gem2deb ( >= 0.6.1~), ruby-narray, pgplot5, gfortran, libx11-dev, libpng12-dev, gfortran-4.6 Standards-Version: 3.9.5 Homepage: http://pgplot.rubyforge.org/ XS-Ruby-Versions: all Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/ruby-pgplot.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-ruby-extras/ruby-pgplot.git;a=summary Package: ruby-pgplot Architecture: any XB-Ruby-Versions: ${ruby:Versions} Depends: ${shlibs:Depends}, ${misc:Depends}, ruby-narray Description: Ruby interface to the PGPLOT graphics library Ruby/PGPLOT is the Ruby interface to the PGPLOT graphics library. PGPLOT is a FORTRAN library to draw line/scatter/histogram plot, error bar, contour/image/vector map, etc. Supports various output devices including Postscript, PNG, X-Window, etc. Package: ruby-pgplot-dbg Section: contrib/debug Priority: extra Architecture: any Depends: ${misc:Depends}, ruby-pgplot (=${binary:Version}) Description: Ruby-PGPLOT debugging symbols Ruby/PGPLOT is the Ruby interface to the PGPLOT graphics library. PGPLOT is a FORTRAN library to draw line/scatter/histogram plot, error bar, contour/image/vector map, etc. Supports various output devices including Postscript, PNG, X-Window, etc. . This package is provided primarily to provide a backtrace with names in a debugger, this makes it somewhat easier to interpret core dumps. Most people will not need this package. debian/watch0000644000000000000000000000011412261304231010205 0ustar version=3 http://rubyforge.org/frs/?group_id=1198 .*/rb_pgplot-(.*)\.tar\.gzdebian/source/0000755000000000000000000000000012261304231010460 5ustar debian/source/format0000644000000000000000000000001412261304231011666 0ustar 3.0 (quilt) debian/doc/0000755000000000000000000000000012261304231007725 5ustar debian/doc/pgimag.html0000644000000000000000000000307312261304231012062 0ustar pgimag

Ruby/PGPLOT example: pgimag

code

require 'narray'
require 'pgplot'
include Pgplot

# set color table
def palett
  rl = [-0.5, 0.0, 0.17, 0.33, 0.50, 0.67, 0.83, 1.0, 1.7]
  rr = [ 0.0, 0.0,  0.0,  0.0,  0.6,  1.0,  1.0, 1.0, 1.0]
  rg = [ 0.0, 0.0,  0.0,  1.0,  1.0,  1.0,  0.6, 0.0, 1.0]
  rb = [ 0.0, 0.3,  0.8,  1.0,  0.3,  0.0,  0.0, 0.0, 1.0]
  pgctab(rl, rr, rg, rb)
end

# prepare Data
nx = 64
ny = 64
x = NArray.sfloat(nx,1).indgen!(1)
y = NArray.sfloat(1,ny).indgen!(1)
f = NMath.cos( NMath.sqrt(x*(80.0/nx))*0.6 - y*16.0/(3.0*ny) ) *
    NMath.cos( x*16.0/(3.0*nx) ) +
    (x/nx - y/ny) + NMath.sin(NMath.sqrt(x**2+y**2))*0.05

# draw Image Map
pgopen
pgwnad(0.0, 1.0+nx, 0.0, 1.0+ny)
palett
pgimag(f)
pgmtxt('t',1.0,0.0,0.0,'PGIMAG, PGWEDG, and PGCTAB')

# draw Color Bar at bottom
pgsch(0.6)
pgbox('bcntsi',0.0,0,'bcntsiv',0.0,0)
pgmtxt('b',3.0,1.0,1.0,'pixel number')
pgwedg('RI', 4.0, 5.0, f.min,f.max, 'pixel value')

output

pgimag.png


Ruby/PGPLOT by Masahiro Tanaka debian/doc/pgline.html0000644000000000000000000000207512261304231012075 0ustar pgline

Ruby/PGPLOT example: pgline

code

require 'narray'
require 'pgplot'
include Pgplot

n = 100
x = NArray.sfloat(n).indgen!/10
y = NMath.sin(x)

pgopen                 # open PGPLOT session
pgenv 0, n/10, -1, 1   # set "Plotter Environment" and draw box.
pglab "x", "y", "PGPLOT Example: y = sin(x)" 
pgsci 2                # set Color Index = Red.
pgslw 5                # set Line Width.
pgline x, y            # plot Line.

output

pgline.png


Ruby/PGPLOT by Masahiro Tanaka debian/doc/method.html.ja0000644000000000000000000002417612261304231012476 0ustar Untitled

module Pgplot

$B%b%8%e!<%k%a%=%C%I(B

$BA`:n(B

pgopen([device])

PGPLOT$B%;%C%7%g%s$r3+;O$9$k!#La$jCM$H$7$F%9%F!<%?%9$rJV$9!#(B

pgbeg([device, [nxsub, [nysub]]])

(obsolete) PGPLOT$B%;%C%7%g%s$r3+;O$9$k!#La$jCM$H$7$F%9%F!<%?%9$rJV$9!#(B

pgask( [true|false] )
pgenv( xmin,xmax,ymin,ymax [,just, axis] )

$B@~!&%^!<%+$NIA2h(B

pgline( xarray, yarray )

xarray, yarray $B$r7k$V@~$rIA$/!#(B xarray, yarray $B$O$=$l$>$l(B X, Y $B:BI8$NG[Ns!#(B

pgpt( xarray, yarray [,symbol] )

xarray, yarray $B$N0LCV$K!"(Bsymbol $B$N%^!<%+$rIA$/!#(B

pgpnts( xarray, yarray, symarray )

xarray, yarray $B$N0LCV$K!"BP1~$9$k(B symarray $B$N%^!<%+$r$=$l$>$lIA$/!#(B

$B%R%9%H%0%i%`(B

pgbin( xarray, yarray [,center] )
pghist( data, nbin [,range, flag] )

$B%(%i!<%P!<(B

pgerrb( dir, x, y, err [,tlen] )

$B%(%i!<%P!<$rIA$/!#(B tlen $B$KC

$BJRB&%(%i!<%P!<(B:
  • dir = 1 for +X (X to X+err)
  • dir = 2 for +Y (Y to Y+err)
  • dir = 3 for -X (X to X-err)
  • dir = 4 for -Y (Y to Y-err)
$BN>B&%(%i!<%P!<(B:
  • dir = 5 for +/-X (X-err to X+err)
  • dir = 6 for +/-Y (Y-err to Y+err)
pgerrx( x1, x2, y [,tlen] )

x1 $B$+$i(B x2 $B$^$G$r7k$V%(%i!<%P!<$rIA$/!#(B tlen $B$KC

pgerry( x, y1, y2 [,tlen] )

y1 $B$+$i(B y2 $B$^$G$r7k$V%(%i!<%P!<$rIA$/!#(B tlen $B$KC

$BEy9b@~(B

pgcont( map, cont [,tr] )

map $B$GM?$($?#2

pgcons( map, cont [,tr] )

PGCONT$B$h$jB.$$%"%k%4%k%:%`$GIA$/$s$@$=$&$J!#(B

pgconb( map, cont [,blank, tr] )

blank$B$GM?$($?CM$r7gB;CM$H$7$FEy9b@~$rIA$/!#(B

pgconf( map, cont_range [,tr] )

cont_range $B$K(B Range$B%/%i%9%*%V%8%'%/%H$GM?$($?HO0O$N%l%Y%k$rEI$jDY$9!#(B

pgconl( map, cont, label [,intval, minint, tr] )

$BEy9b@~$K%i%Y%k$r$D$1$k!#(B

$B2hA|(B

pgimag( array [,range, tr] )

$B%+%i!<%9%1!<%k$G(B array ($B#2

pgctab( l, r,g,b [,contra,bright] )

pgimag $B$G;HMQ$9$k%+%i!<%F!<%V%k$r@_Dj$9$k!#(B

pggray( array [,range, tr] )

$B%0%l!<%9%1!<%k$G(B array ($B#2

pgpixl( array [,x1,x2,y1,y2] )

array ($B#2

pgvect( x, y [,scale, pos, tr, blank] )

$B%Y%/%H%k>l$rIA$/!#(B

$B:BI8<4$NIA2h(B

pgtick( x1, y1, x2, y2, v, [str], {"tickl", "tickr", "disp", "orient"} )
pgaxis( x1, y1, x2, y2, v1, v2,
{"opt", "step", "nsub", "tickl", "tickr", "frac", "disp", "orient"} )

$B%+!<%=%kF~NO(B

pgcurs([x,y])

$B%/%j%C%/$^$?$O%-!<%?%$%W$N%$%Y%s%H$r

pgband( mode, [ xref, yref, [x, y, [posn]]])

$B%/%j%C%/$^$?$O%-!<%?%$%W$N%$%Y%s%H$rJN,$9$k$H8=:_0LCV$H$J$k!#(B $B%$%Y%s%H$r

  • mode=0 : $BIA2h$J$7!#(B
  • mode=1 : $B%"%s%+!
  • mode=2 : $B%"%s%+!
  • mode=3 : $B%"%s%+!$l$rDL$k#2K\$N?eJ?@~!#(B
  • mode=4 : $B%"%s%+!$l$rDL$k#2K\$N?bD>@~!#(B
  • mode=5 : $B%+!<%=%k0LCV$rDL$k?eJ?@~!#(B
  • mode=6 : $B%+!<%=%k0LCV$rDL$k?bD>@~!#(B
  • mode=7 : $B%+!<%=%k0LCV$rDL$k==;z@~!#(B
pgolin( x, y, [sym, [npt]] )

$B%^%&%9%+!<%=%k$G:BI8$rO"B3$7$FF~NO$9$k!#(B x,y $B$K$O$"$i$+$8$a(B NArray::SFLOAT $B7?$NG[Ns$rM?$($F$*$-!"(B $B$=$3$X%/%j%C%/$7$?=gHV$K:BI8$r5-O?$7$F$$$/!#(B $BF~NO$G$-$k8D?t$O$3$NG[Ns$N%5%$%:$G@)8B$5$l$k!#(B $B%+!<%=%k$GF~NO$7$?E@$O!"%^!<%+(B sym $B$GIA2h$5$l$k!#(B npt $B$r;XDj$9$k$H!"$"$i$+$8$a(B npt $B8D$NE@$,F~NO$5$l$F$$$k$H$_$J$9!#(B $BLa$jCM$OF~NO$7$?E@$N?t!#(B

pgncur( x, y, [sym, [npt]] )

x,y$B$K5-O?$5$l$k=gHV$,(B x $B$N>.$5$$=g$G$"$k$3$H$r=|$-!"(Bpgolin $B$HF1$8!#(B

pglcur( x, y, [npt] )

$BF~NO$7$?E@$r7k$V@~$,IA$+$l$k$3$H$r=|$$$F!"(Bpgolin $B$HF1$8!#(B

$B%9%F!<%?%9$rJV$9(B

pgqinf(item)
value = pgqinf(item)
pgqdt([ndev])
type, descr, inter = pgqdt([ndev])
debian/doc/pghist.html0000644000000000000000000000246112261304231012114 0ustar pghist

Ruby/PGPLOT example: pghist

code

require 'narray'
require 'pgplot'
include Pgplot

pgopen
srand(1)

# draw main Histogram of Normal distribution
data = NArray.sfloat(1000).randomn!
pghist(data, 31, -3.1..3.1, 0)

# draw sub Histogram of Normal distribution with gray bars
data = NArray.sfloat(200).randomn!*0.5 + 1 
pgsci(15)
pghist(data, 31, -3.1..3.1, 3)
pgsci(0)  # draw black frame
pghist(data, 31, -3.1..3.1, 1)

pgsci(1)
pgbox('BST', 0.0, 0, ' ', 0.0, 0)
pglab('Variate', ' ','PGPLOT Example 4:  Histograms (Gaussian)')

# draw Gaussian Curve
x = NArray.sfloat(620).indgen!*0.01 - 3.1
y = NMath.exp(-(x**2)*0.5) * (0.2*1000/NMath.sqrt(2*Math::PI))
pgline(x,y)

output

pghist.png


Ruby/PGPLOT by Masahiro Tanaka debian/doc/index.html0000644000000000000000000000420512261304231011723 0ustar index

Ruby/PGPLOT

A Ruby interface to the PGPLOT graphics library. NArray is required.

Download

Installation

Examples

Manual

Link

  • Rongo - simple mongo-like plotting library using Ruby/PGPLOT.
debian/doc/pgcont.html0000644000000000000000000000220012261304231012077 0ustar pgcont

Ruby/PGPLOT example: pgcont

code

require "narray"
require "pgplot"
include Pgplot

# Preparing data
x = NArray.sfloat(40,1).indgen!(1)
y = NArray.sfloat(1,40).indgen!(1)
map = NMath.cos( NMath.sqrt(x*2)*0.3 - y*0.4/3 ) * NMath.cos( x*0.4/3 ) \
      + (x-y)/40
n = 21
level = NArray.sfloat(n).indgen! * (map.max-map.min)/n + map.min

# Draw contour map
pgopen
pgenv(1,40,1,40)    # set "Plotter Environment" and draw box.
pgsci(3)            # set Color Index to Green.
pgcont  map, level

output

pgcont.png


Ruby/PGPLOT by Masahiro Tanaka debian/doc/trailer.html0000644000000000000000000000006612261304231012257 0ustar
Ruby/PGPLOT by Masahiro Tanaka debian/doc/install.html.ja0000644000000000000000000001231312261304231012652 0ustar Untitled

PGPLOT$B$N%$%s%9%H!<%k(B

PGPLOT$B$O(B configure $B$r;H$o$J$$$N$G%$%s%9%H!<%k$,$N(BOS$B$G$b(BUNIX$B$J$i$[$H$s$IF1$8$h$&$K$7$F%$%s%9%H!<%k$G$-$k$H;W$$$^$9!#(B $BK\2H$N%$%s%9%H!<%k@bL@$N%Z!<%8(B $B$b$4Mw2<$5$$!#(B

PGPLOT$B$N%=!<%9$rMQ0U(B

PGPLOT$B$N%5%$%H(B $B$+$i(B $B%=!<%9%3!<%I(B $B$r%@%&%s%m!<%I!"E83+$7!"(Bpgplot$B$N%G%#%l%/%H%j$K0\F0$7$^$9!#(B

gunzip -c pgplot5.2.tar.gz | tar xvf -
cd pgplot

$B:n6H%G%#%l%/%H%j$r:n@.(B

$B:n6H%G%#%l%/%H%j$r:n$j$^$9!#$3$3$G$O(B build $B$H$$$&L>A0$K$7$^$9!#(B

mkdir build
cd build

drivers.list$B$rJT=8(B

PGPLOT$B$GIA2h$r=PNO$9$k%I%i%$%P$rA*Br$7$^$9!#(B drivers.list $B$H$$$&%U%!%$%k$r%3%T!<$7$F%(%G%#%?$G3+$-!"(B $B;H$$$?$$%I%i%$%P$N9T$NF,$N(B ! $B$NJ8;z$r:o=|$7$^$9!#(B

cp ../drivers.list .
vi drivers.list

$B%I%i%$%P$O$*9%$_$GA*Br$G$-$^$9$,!"(BUNIX$B$J$i(B PNG, PPM, Postscipt, XWD, XWINDOW, XSERVE, XTERM $B$"$?$j$rA*$s$G$*$/$N$,0lHLE*$G$7$g$&!#(B PNG driver$B$rAH$_9~$`$K$O!"(B libpng $B$,I,MW$G$9!#(B $BB>$K$b$?$/$5$s$N%I%i%$%P$,4^$^$l$F$$$^$9$,!"(B $B%W%j%s%?%I%i%$%P$NCf$K$O%3%s%Q%$%k$N;~$K%(%i!<$,=P$k$b$N$,$"$C$?$j!"(B GIF$B$O%i%$%;%s%9$K0z$C3]$+$C$?$j$7$^$9!#(B

makefile $B:n@.(B

$B

../makemake .. sol2 g77_gcc

1$BHVL\$N0z?t$O%=!<%9$N$"$k%G%#%l%/%H%j$N;XDj$G$9!#(B $B$3$3$G$O%=!<%9%G%#%l%/%H%j$N2<$K$$$k$N$G!"(B.. $B$r;XDj$7$^$9!#(B 2$BHVL\$N0z?t$O(BOS$B$Nsys_* $B$H$$$&%G%#%l%/%H%j$NCf$N(B * $B$NItJ,$r;XDj$7$^$9!#(B 3$BHVL\$N0z?t$O%3%s%Q%$%i$J$I$N@_Dj$G!"(Bsys_* $B$N2<$K$"$k(B *.conf $B$H$$$&%U%!%$%k$N(B * $B$NItJ,$r;XDj$7$^$9!#(B $B$b$7$3$NCf$K$J$1$l$P!":G$b6a$=$&$J$d$D$rA*$S$^$9!#(B

makefile $B$r:n@.$7$?$i!"$6$C$H8+$F@_Dj$,@5$7$$$+%A%'%C%/$7$^$9!#(B $B$3$3$G!"(BPGPLOT ver 5.2.2 $B$G(B PNG driver$B$r;H$&>l9g!"(B $BEG$-=P$5$l$?(B makefile $B$O!"(B

pndriv.o : ./png.h ./pngconf.h ./zlib.h ./zconf.h

$B$H$$$&$^$:$$@_Dj$K$J$C$F$$$k$N$G!"$3$N9T$r:o=|$7$^$9!#(B

$B%3%s%Q%$%k(B

makefile $B$rJT=8$7$?$i!"%i%$%V%i%j$r%3%s%Q%$%k$7$^$9!#(B

make
make cpg

$B%$%s%9%H!<%k(B

make install $B$,MQ0U$5$l$F$$$J$$$N$G!"

setenv PREFIX  /usr/local
setenv PGPLOT_DIR  ${PREFIX}/pgplot

$B%$%s%9%H!<%k@h$O<+M3$KA*$Y$^$9$,!"(B $B%3%s%Q%$%k;~$K%Q%9;XDj$,I,MW$K$J$k$+$b$7$l$^$;$s!#(B $B

cp -p libpgplot.a libpgplot.so* libcpgplot.a ${PREFIX}/lib
cp -p cpgplot.h ${PREFIX}/include
mkdir ${PGPLOT_DIR}
cp -p grfont.dat rgb.txt pgxwin_server ${PGPLOT_DIR}

$B$3$l$G%$%s%9%H!<%k=*N;$G$9!#(B

$B%G%b$N

$B%3%s%Q%$%k$,$&$^$/$$$C$?$+$I$&$+%G%b%W%m%0%i%`$rAv$i$;$F$_$^$7$g$&!#(B $B%3%s%Q%$%k$7$?%G%#%l%/%H%j$K(B pgdemo1 $B$+$i(B pgdemo17 $B$^$G$H(B cpgdemo $B$H$$$&

$B%f!<%6@_Dj(B

PGPLOT$B$r;H$&%f!<%6$O!"4D6-JQ?t$X

setenv PGPLOT_DIR  /usr/local/pgplot
setenv PGPLOT_DEV  /xwin

PGPLOT_DIR $B$O>e$G%$%s%9%H!<%k$7$?%G%#%l%/%H%j$HF1$8!"(B PGPLOT_DEV $B$O%G%U%)%k%H$N%G%P%$%9$G$9!#(B $B$=$NB>$N4D6-JQ?t$OFC$K@_Dj$7$J$/$F$b$$$$$H;W$$$^$9$,!">\$7$/$O(B $B$3$3(B $B$r$4Mw2<$5$$!#(B


Ruby/PGPLOT by Masahiro Tanaka debian/doc/rbpg-ind.html0000644000000000000000000003522412261304231012323 0ustar rbpg-ind

Ruby/PGPLOT categorized method index

Drawing primitives

  • pgline -- draw a polyline (curve defined by line-segments)
  • pgpoly -- draw a polygon, using fill-area attributes
  • pgpt1 -- draw one graph marker
  • pgpt -- draw several graph markers
  • pgpnts -- draw several graph markers, not all the same
  • pgarro -- draw an arrow
  • pgcirc -- draw a circle, using fill-area attributes
  • pgrect -- draw a rectangle, using fill-area attributes
  • pgmove -- move pen (change current pen position)
  • pgdraw -- draw a line from the current pen position to a point

Axis

  • pgaxis -- draw an axis
  • pgbox -- draw labeled frame around viewport
  • pgtick -- draw a single tick mark on an axis
  • pgtbox -- draw frame and write (DD) HH MM SS.S labelling

Text

  • pglab -- write labels for x-axis, y-axis, and top of plot
  • pgtext -- write text (horizontal, left-justified)
  • pgmtxt -- write text at position relative to viewport
  • pgptxt -- write text at arbitrary position and angle
  • pgetxt -- erase text from graphics display
  • pgiden -- write username, date, and time at bottom of plot
  • pglen -- find length of a string in a variety of units
  • pgqtxt -- find bounding box of text string

Histgram

  • pgbin -- histogram of binned data
  • pghist -- histogram of unbinned data

Error bar

  • pgerr1 -- horizontal or vertical error bar
  • pgerrb -- horizontal or vertical error bar
  • pgerrx -- horizontal error bar
  • pgerry -- vertical error bar

2D drawing

  • pgcont -- contour map of a 2D data array (contour-following)
  • pgcons -- contour map of a 2D data array (fast algorithm)
  • pgconb -- contour map of a 2D data array, with blanking
  • pgconf -- fill between two contours
  • pgconl -- label contour map of a 2D data array
  • pgconx -- contour map of a 2D data array (non rectangular) (not implemented in Ruby/PGPLOT)
  • pgimag -- color image from a 2D data array
  • pgctab -- install the color table to be used by pgimag
  • pggray -- gray-scale map of a 2D data array
  • pgpixl -- draw pixels
  • pgvect -- vector map of a 2D data array, with blanking
  • pgwedg -- annotate an image plot with a wedge
  • pghi2d -- cross-sections through a 2D data array

Cursor

  • pgband -- read cursor position, with anchor
  • pgcurs -- read cursor position
  • pglcur -- draw a line using the cursor
  • pgncur -- mark a set of points using the cursor
  • pgolin -- mark a set of points using the cursor

Control

  • pgopen -- open a graphics device
  • pgbeg -- open a graphics device
  • pgclos -- close the selected graphics device
  • pgend -- close all open graphics devices
  • pgenv -- set window and viewport and draw labeled frame
  • pgask -- control new page prompting
  • pgpage -- advance to new page
  • pgeras -- erase all graphics from current page
  • pgbbuf -- begin batch of output (buffer)
  • pgebuf -- end batch of output (buffer)
  • pgpanl -- switch to a different panel on the view surface
  • pgpap -- change the size of the view surface
  • pgrnge -- choose axis limits
  • pgsave -- save PGPLOT attributes
  • pgunsa -- restore PGPLOT attributes
  • pgscrl -- scroll window
  • pgsubp -- subdivide view surface into panels
  • pgupdt -- update display

Set attributes

  • pgsah -- set arrow-head style
  • pgscf -- set character font
  • pgsch -- set character height
  • pgsci -- set color index
  • pgscir -- set color index range
  • pgsclp -- enable or disable clipping at edge of viewport
  • pgscr -- set color representation
  • pgscrn -- set color representation by name
  • pgsfs -- set fill-area style
  • pgshls -- set color representation using HLS system
  • pgshs -- set hatching style
  • pgsitf -- set image transfer function
  • pgslct -- select an open graphics device
  • pgsls -- set line style
  • pgslw -- set line width
  • pgstbg -- set text background color index
  • pgsvp -- set viewport (normalized device coordinates)
  • pgswin -- set window
  • pgvsiz -- set viewport (inches)
  • pgvstd -- set standard (default) viewport
  • pgwnad -- set window and adjust viewport to same aspect ratio

Inquire attributes

  • pgldev -- list available device types on standard output
  • pgqah -- inquire arrow-head style
  • pgqcf -- inquire character font
  • pgqch -- inquire character height
  • pgqci -- inquire color index
  • pgqcir -- inquire color index range
  • pgqclp -- inquire clipping status
  • pgqcol -- inquire color capability
  • pgqcr -- inquire color representation
  • pgqcs -- inquire character height in a variety of units
  • pgqdt -- inquire name of nth available device type
  • pgqfs -- inquire fill-area style
  • pgqhs -- inquire hatching style
  • pgqid -- inquire current device identifier
  • pgqinf -- inquire PGPLOT general information
  • pgqitf -- inquire image transfer function
  • pgqls -- inquire line style
  • pgqlw -- inquire line width
  • pgqndt -- inquire number of available device types
  • pgqpos -- inquire current pen position
  • pgqtbg -- inquire text background color index
  • pgqvp -- inquire viewport size and position
  • pgqvsz -- inquire size of view surface
  • pgqwin -- inquire window boundary coordinates

Hereafter not implemented in Ruby/PGPLOT

Utility

  • pgnumb -- convert a number into a plottable character string
  • pgrnd -- find the smallest `round' number greater than x

Drawing function

  • pgfunt -- function defined by X = F(T), Y = G(T)
  • pgfunx -- function defined by Y = F(X)
  • pgfuny -- function defined by X = F(Y)

Alias


Ruby/PGPLOT by Masahiro Tanaka debian/doc/tutorial-01.html.ja0000644000000000000000000000714512261304231013274 0ustar Untitled

Ruby/PGPLOT $BF3F~JT(B

$B@^$l@~%0%i%U$rIA$/(B

Ruby/PGPLOT$B$G@^$l@~%0%i%U$rIA$/:G>.8B$N%9%/%j%W%H$O!"0J2<$N$h$&$K$J$j$^$9!#(B

require 'narray'
require 'pgplot'
include Pgplot
pgopen                           # $B%G%P%$%9$r3+$/(B
pgenv( 0, 5, 0, 5 )              # $BOH$N@_Dj$HIA2h(B
pgline( [1,2,3,4], [1,4,1,4] )   # $B@^$l@~$NIA2h(B

$B0J2<$3$N%9%/%j%W%H$K$D$$$F>\$7$/@bL@$7$^$9!#(B 1$B9TL\!"(B2$B9TL\$G3HD%%i%$%V%i%j$r%m!<%I$7$^$9!#(B

3$B9TL\$G$O(B Pgplot$B%b%8%e!<%k$r%$%s%/%k!<%I$7$F$$$^$9!#(B $B$3$l$r$7$J$$$H(B Pgplot$B$N%a%=%C%I$r8F$V$H$-!"(B``Pgplot.pgopen'' $B$H$$$&$h$&$K(B $B%b%8%e!<%kL>$r%a%=%C%I$NA0$K>JN,$7$J$$$G=q$+$J$1$l$P$J$j$^$;$s!#(B $B%$%s%/%k!<%I$9$k$+$I$&$+$O>l9g$K$h$j$^$9!#(B Pgplot$B%b%8%e!<%k$N%a%=%C%IL>$O(B($B:#$N$H$3$m(B)$B3'(B ``pg'' $B$G;O$^$C$F$$$k$N$G!"(B $B5$$r$D$1$l$PL>A0$,$V$D$+$k3NN($ODc$$$H;W$$$^$9$,!"(B $B3N

4$B9TL\$N(B pgopen $B$G(B PGPLOT $B$N%0%i%U%#%/%9%G%P%$%9$r3+$-$^$9!#(B $B$3$3$G0z?t$r=q$+$J$$$H;HMQ$9$k%G%P%$%9$rJ9$$$F$-$^$9!#(B

Graphics device/type (? to see list, default /xwin):

$B%G%U%)%k%H$N$^$^$GNI$1$l$PC1$K%j%?!<%s%-!<$r2!$7$^$9!#(B $B%G%U%)%k%H$N%G%P%$%9$O4D6-JQ?t(B PGPLOT_DEV $B$G@_Dj$7$?$b$N$K$J$C$F$$$^$9!#(B `?'$B$H%j%?!<%s$rBG$A9~$`$H!";HMQ$G$-$k%G%P%$%9$N0lMw$,I=<($5$l$k$N$G!"(B $B$=$NCf$+$iJL$N%G%P%$%9$rA*Br$9$k$3$H$b$G$-$^$9!#(B $BNc$($P!"(BPNG$B$H$7$F%U%!%$%k$K=q$-=P$7$?$$$H$-$O!"(B ``plot1.png/png'' $B$N$h$&$K!V%U%!%$%kL>(B/$B%G%P%$%9L>!W$H$$$&$h$&$K;XDj$7$^$9!#(B

5$B9TL\$N(B

pgenv( 0, 5, 0, 5 )

$B$K$h$j!"%0%i%U$N<4$r7hDj$7!"OH$HL\@9$rIA2h$7$^$9!#(B $B0z?t$O(B x-min, x-max, y-min, y-max $B$N=g$G$9!#(B $B$3$3$G$O(BX$B<4$,(B0$B$+$i(B5$B!"(BY$B<4$,(B0$B$+$i(B5$B$^$G$NHO0O$NOH$rIA$-$^$9!#(B $B0J9_$O$3$3$G@_Dj$5$l$?:BI8$r$b$H$KIA2h$7$^$9!#(B

$B$=$7$F$$$h$$$h!"(B6$B9TL\$N(B

pgline( [1,2,3,4], [1,4,1,4] )

$B$G!"@^$l@~%0%i%U$rIA$-$^$9!#(B $B0z?t$K$O@~$r7k$VE@$N(BX$B:BI8$H(BY$B:BI8$r$=$l$>$lG[Ns$GEO$7$^$9!#(B

$B$3$3$^$G@.8y$9$l$P!"$3$N$h$&$J%0%i%U$,IA$+$l$F$$$k$O$:$G$9!#(B

plot1.png

$B0J>e$,@^$l@~%0%i%U$rIA$/$N$K:GDc8BI,MW$J%a%=%C%I$G$9!#(B

$B$H$3$m$G!"$3$N%9%/%j%W%H$K$O%G%P%$%9$rJD$8$k%a%=%C%I$,$"$j$^$;$s!#(B C$B$+(BFORTRAN$BHG$N(BPGPLOT$B$G$"$l$P!"(B $B$3$3$G:G8e$K(B pgend $B$r8F$s$G%G%P%$%9$rJD$8$kI,MW$,$"$j$^$9!#(B $B$=$&$7$J$$$H!"%G%P%$%9$,(B Postscript $B$J$I$N$H$-!"(B $B=*N;=hM}$,$5$l$J$$$N$G!"IT40A4$J%U%!%$%k$,$G$-$F$7$^$$$^$9!#(B $B$7$+$7(B Ruby/PGPLOT$B$G$O!"(BRuby$B%$%s%?%W%j%?=*N;;~$K(B pgend $B$r<+F0E*$K8F$V$h$&$K$J$C$F$$$k$N$G!"(B $BI,$:$7$b:G8e$K(B pgend $B$r8F$VI,MW$O$"$j$^$;$s!#(B $B$?$@$7(BRuby$B$N

$B0J2


Ruby/PGPLOT by Masahiro Tanaka