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?
已存档?
是复刻?
已锁定?
是镜像?
是私有?