guff

a plot device

  • 所有者: silentbicycle/guff
  • 平台:
  • 許可證: ISC License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

guff: a plot device

guff reads a stream of points from a file / stdin and plots them.

guff is short for MacGuffin.

guff is distributed under the ISC License.

Plots them?

It can plot to stdout:

$ wc -l *.c, grep -v total, sort -nr, awk '{print($1)}', ./guff -d 72x30
    x: [0 - 15]    y: [0 - 302] -- 0: #
+                                                                       
#, +, #, #, +             #, #, #, #, +                                #, #, +, #    #, #, #               
+, #, #    # 
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+-


$ ./guff -d 40x20 -m count test_sin
    x: [0 - 720]    y: [-1 - 1]
+, ijjh, 9j1  2j8, ba      ba, 98        98     
+                     6a          b5, 1d            e, e              e, 94              58, 2a                a2 
6----+----+----+---d+----+----+----+--8-
49                94, a3              49, e              e, 2c            d1                      
+  78          96, b6        7a, d7      8c, cg    hb, 3jjjj2                           

Or to SVG:

$  wc -l *.c, grep -v total, sort -nr, awk '{print($1)}', ./guff -s -m line -r > example.svg

cat <<EOF, ./guff -s -x -m count
1 1
1 2
-2 -3
3 -4
-2 -3
2 4
3 -4
1 2
3 5
-2 -3

Input format

guff reads a stream of lines of floating point numbers, separated by a single character:

1 2.0 3

and

1,2,3

both read as 1.0, 2.0, 3.0.

If multiple separators appear, then the value is treated as missing for that column's row:

1,,3

reads as 1.0, [missing value], 3.0.

Any line beginning with "/" or "#" is ignored, and anything else that
strtod(3) considers an ill-formatted number (e.g. "-") will lead to
the rest of the line being skipped.

Blank lines

Blank lines make guff plot and reset. For example, guff can be used to
convert an infinite stream of data periodically broken up by blank lines
into an infinite stream of SVG plots, also broken up by blank lines.
(The included script, discretion, splits these into timestamped SVG
files and updates a symlink to the newest.)

Why write another plotter?

Not everything has graphic libraries installed (or a graphic environment at all),
and sometimes it's helpful to get a rough feel for data's distribution from a
text-mode command line. SVG images can also be generated pretty easily.

Installation

guff depends on on nothing besides a standard POSIX environment.

To build it, type make.

To run the tests, type make test.

Usage

Usage: guff [-A] [-c] [-d WxH] [-f] [-h] [-l xyc]
            [-m MODE] [-r] [-s] [-S] [-x] [FILE]

Common options:

-d WxH: set width and height (e.g. "-d 72x40", "-d 640x480")
-f: flip x & y axes in plot
-h: print help message
-l LOG: any of 'x', 'y', 'c' -- set X, Y, and/or count to log scale
-m MODE: dot, count, line (SVG only), default dot
-s: render to SVG
-x: treat first column as X for all following Y columns (def: use row count)

SVG only:

-c: use colorblind-safe default colors
-r: draw linear regression lines

Other options (mostly for internal testing):

-A: don't draw axes
-S: disable stream mode

For more details, see the man page.

主要指標

概覽
名稱與所有者silentbicycle/guff
主編程語言C
編程語言Makefile (語言數: 4)
平台
許可證ISC License
所有者活动
創建於2015-07-05 19:15:43
推送於2019-09-08 21:02:38
最后一次提交2016-07-05 07:39:01
發布數1
最新版本名稱v0.1.0 (發布於 2015-07-05 15:24:10)
第一版名稱v0.1.0 (發布於 2015-07-05 15:24:10)
用户参与
星數315
關注者數12
派生數11
提交數7
已啟用問題?
問題數3
打開的問題數3
拉請求數0
打開的拉請求數3
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?