Top/App/gnuplot

目次

Link

その他の文書

グラフの描画

  1. 起動画面
    $ gnuplot
    
            G N U P L O T
            Version 4.0 patchlevel 0
            last modified Thu Apr 15 14:44:22 CEST 2004
            System: Linux 2.6.9-5.ELsmp
    
            Copyright (C) 1986 - 1993, 1998, 2004
            Thomas Williams, Colin Kelley and many others
    
            This is gnuplot version 4.0.  Please refer to the documentation
            for command syntax changes.  The old syntax will be accepted
            throughout the 4.0 series, but all save files use the new syntax.
    
            Type `help` to access the on-line reference manual.
            The gnuplot FAQ is available from
                    http://www.gnuplot.info/faq/
    
            Send comments and requests for help to
                    <gnuplot-info@lists.sourceforge.net>
            Send bugs, suggestions and mods to
                    <gnuplot-bugs@lists.sourceforge.net>
    
    
    Terminal type set to 'x11'
    gnuplot>
  2. 関数の入力
    • 今のところ、乗数の表記(^)は使えない
    • 三角関数 sin(x)
      gnuplot> plot sin( x )
    • 三角関数での単位は、degree, radian が使用可。変更するには
      gnuplot> set angles degree (またはradian)
      のようにする。
    • 円周率は "pi" を使う
  3. 値域を指定する。 値域の指定は、 "[最小値:最大値]" の型式で指定出来る。
    gnuplot> plot [-0:2*pi] sin(x)

描画後のグラフ

画像として保存したい場合

xwd というコマンドを使って、画像ファイル化して保存出来る。

  1. gnuplotで何某かのグラフを描画する
    gnuplot> plot [-0:2*pi] sin(x)
  2. 別shell からxwd を起動する。
    $ xwd -frame -out image.xwd
    Option備考
    -frameWindowManagerのWindow枠も一緒に加える場合は指定する。
    -out <file-name>保存先の画像ファイル名
    -rootルートウィンドウも保存したい場合に指定する。
  3. 画像ファイルにしたいウィンドウを指定。 xwd が起動すると、マウスカーソルが十字になるので、画像ファイルに落したいウィンドウをクリックする。画像ファイルは xwd型式で保存される。
  4. xwdの画像を見る
    $ xwud -in image.xwd 
  5. 一般的な型式に変換する。 ImageMagickの convert、若しくは GIMPなどで変換する。
    $ convert image.xwd image.png
    • jpgにすると、画質がかなり劣化する。
    • pngなら、まぁまぁの画質。

トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2019-06-09 (日) 16:59:05