[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dennou-ruby:001978] Re: gpprint, gpview



塚原さま

> > このバージョンを gphys の CVS に加えました。
> > 今後は変更はこちらにコミットしてください。
> > cvs 版ではカラーバーも使えます。
> 
> ありがとうございます. これでやっとカラーバーが実装できます.

一緒にコミットした変更で、GGraph に margin_info というメソッドを
加えましたので利用してみてください。DCL.gropn のすぐ後に

  GGraph.margin_info(nil, '/data/hoge.nc')

などと呼ぶと、下側にマージンをとって、プログラムやデータに関する
情報を小さく出力します。第一引数は省略(nil)すると実行プログラム
のフルパスに置き換えられます。フルパスはうざい場合は陽に $0 を与
えればいいです。gpview の場合のお勧めの呼び方は、

  GGraph.margin_info($0, gturl)

だろうと思います。gturl がファイル名、変数名、スライスの切り方を
含むので結構いいんでは? ちなみに DCL.slsmgn を内部で呼んでるの
ですが、文字列の長さが 100 文字までとなってるのがちょっと問題。
100文字を越えたら適当に '..' を間にいれて縮めるようにしたいので
すが、まだやってません。(「適当」の加減を考えないとならないので。)

フルの規格は下記:

---margin_info(program=nil, data_source=nil, char_height=nil, date=true, \
   xl=0.0, xr=0.0, yb=nil, yt=0.0)

    Set the strings to appear in the bottom margin.

    This method sets margin widths as DCL.slmgn(xl, xr, yb, yt),
    and sets the 1st and 2nd margin strings as (({program}))
    and (({data})).

    ARGUMENTS
    * program (String or nil) : String to be put on the left side in
      the bottom margin. This is meant to represent the name of the
      execution program. Therefore, if it is nil, the full path of 
      $0 is used.

    * data_source (String or nil) : String to be put on the right side in
      the bottom margin. This is meant to represent the data file name or the
      directory in which the data are situated.
      If nil, the full path of the current directory is used
      (but nothing is shown if it is equal to the directory of the program).

    * date (true or false(nil)) : whether to put todays date

    * char_height (Float or nil) : height of the string to appear
      in the V coordinate. If nil, internally defined.

    * xl, xr, yb, yl (Float --- nil is available for yb) : margin
      size in the V coordinate. The margin is set as
      DCL.slmgn(xl, xr, yb, yt). If (({yb})) is nil, it is determined
      internally as (({2.0 * char_height})).

--
堀之内 武                    horinout@xxxxxxxxxxxxxxxxxx
京都大学生存圏研究所               611-0011 宇治市五ヶ庄