Guile Charting

(charting)

Overview

Usage

make-bar-chart [title] [data] [write-to-png] [bar-width] [group-spacing] [chart-height] [max-y] [chart-params] [legend-params] [ytick-label-formatter] [bar-value-formatter]
[Function]

Make a bar chart.

The format of data is defined as follows:

data

(group+)

group

(group-label bar+)

group-label

A string, to be written to the X axis.

bar

(height bar-params?)

height

The bar height, as a number.

bar-params

A property list suitable to passing to charting draw draw-bar.

This function returns the cairo surface. By default, make-chart will create an image surface, but you may override this by passing a #:make-surface function in the chart-params. In this way you can render charts to any surface supported by Cairo, e.g. PS, PDF, SVG, GDK, etc.

The #:write-to-png option will write the chart out to the PNG file that you name.

An example invocation might look like:

 (make-bar-chart "Average Height at Iihenda JSS"
                 '(("Grade 9" (150 "Boys") (140 "Girls"))
                   ("Grade 10" (150 "Boys")
                               (140 "Girls" (#:y+-bracket 5 #:y--bracket 4.5))))
                 #:write-to-png "/tmp/graph.png")
make-chart [title] [chart-height] [chart-width] [font-family] [line-width] [title-text-height] [axis-text-height] [x-axis-label] [y-axis-label] [tick-size] [y-axis-ticks] [x-axis-ticks] [y-axis-tick-labels] [x-axis-tick-labels] [x-axis-tick-mode] [y-axis-tick-mode] [chart-margin] [margin] [padding-left] [padding-right] [padding-top] [padding-bottom] [make-surface]
[Function]

Make a chart.

tick-lables is an alist of label-value pairs, where the value is given in chart height coordinates. The label can be #f.

This function makes the basic chart, setting up the basics like the title, axes, etc. You probably don't want to call this unless you are making a custom chart type.

This function returns a cairo context whose coordinate system has been flipped so that the origin of the chart is (0, 0), with positive in the northeast quadrant.

make-page-map [title] [data] [write-to-png] [margin] [page-size] [page-width] [page-height] [page-spacing] [title-text-height] [text-height] [label-bar-spacing] [font-family]
[Function]
Make a page map.

A page map shows the components of a one-dimensional space.  Each
component has a label, a start, and a size.  The result is a graphical
representation of the space, divided in @var{page-size} strips, along
with a summary list of the different components.

The format of @var{data} is as follows:

@example
 ((@var{label} . (@var{start} . @var{size})) ...)}
@end example

@var{label} should be a string.  @var{start} and @var{size} should be
numbers.

The #:write-to-png option will write the chart out to the PNG file
that you name.

An example invocation might look like:

@example
 (make-page-map
  "foo.so"
  '((".text" 1024 65535)
    (".data" 65536 20)
    (".rodata" 65556 200))
  #:write-to-png "foo.png")
@end example
make-performance-chart [title] [data] [write-to-png] [box-width] [box-spacing] [test-spacing] [chart-height] [max-y] [min-y] [chart-params] [legend-params] [ytick-label-formatter] [box-value-formatter]
[Function]

Make a performance chart.

A performance chart compares runtimes for some set of tests across some set of scenarios.

The format of data is defined as follows:

 ((scenario (test data-point ...) ...) ...)

scenario and test should be strings. data-point should be numbers.

The resulting plot will have time on the Y axis, and one X axis entry for each test. Each test/scenario data set will be represented as a box plot. In the future we should add more options (for example, a small vertical histogram on the plot).

This function returns the cairo surface. By default, make-chart will create an image surface, but you may override this by passing a #:make-surface function in the chart-params. In this way you can render charts to any surface supported by Cairo, e.g. PS, PDF, SVG, GDK, etc.

The #:write-to-png option will write the chart out to the PNG file that you name.

An example invocation might look like:

 (make-performance-chart
  "Gabriel Benchmarks"
  '(("guile-1.8"
     ("tak" 0.12 0.13 0.17)
     ("fib" 1.13 1.24 1.05))
    ("guile-2.0"
     ("tak" 0.05 0.051 0.047)
     ("fib" 0.64 0.59 0.71)))
  #:write-to-png "/tmp/graph.png")
make-performance-series [title] [data] [write-to-png] [box-width] [box-spacing] [test-spacing] [chart-height] [max-y] [min-y] [chart-params] [annotations] [ytick-label-formatter] [box-value-formatter]
[Function]

Make a performance chart.

A performance chart compares runtimes for some set of tests across some set of scenarios.

The format of data is defined as follows:

 ((x data-point ...) ...)

x and data-point should be numbers.

The resulting plot will have time on the Y axis, and one X axis entry for each test. Each data set will be represented as a box plot. In the future we should add more options (for example, a small vertical histogram on the plot).

This function returns the cairo surface. By default, make-chart will create an image surface, but you may override this by passing a #:make-surface function in the chart-params. In this way you can render charts to any surface supported by Cairo, e.g. PS, PDF, SVG, GDK, etc.

The #:write-to-png option will write the chart out to the PNG file that you name.

An example invocation might look like:

 (make-performance-chart
  "Gabriel Benchmarks"
  '(("guile-1.8"
     ("tak" 0.12 0.13 0.17)
     ("fib" 1.13 1.24 1.05))
    ("guile-2.0"
     ("tak" 0.05 0.051 0.047)
     ("fib" 0.64 0.59 0.71)))
  #:write-to-png "/tmp/graph.png")
make-scatter-plot [title] [data] [write-to-png] [test-spacing] [chart-height] [min-x] [max-x] [min-y] [max-y] [log-x-base] [log-y-base] [chart-params] [legend-params] [x-axis-label] [y-axis-label] [tick-label-formatter]
[Function]

Make a scatter plot.

A scatter plot shows a number of series as individual points.

The format of data is defined as follows:

 ((series (x . y) ...) ...)

series should be a string. x and y should be numbers.

This function returns the cairo surface. By default, make-chart will create an image surface, but you may override this by passing a #:make-surface function in the chart-params. In this way you can render charts to any surface supported by Cairo, e.g. PS, PDF, SVG, GDK, etc.

The #:write-to-png option will write the chart out to the PNG file that you name.

An example invocation might look like:

 (make-scatter-plot
  "MPG for cars"
  '(("ford" (1 . 2) (2 . 3))
    ("opel" (1.2 . 3.5) (4.5 . 1)))
  #:write-to-png "/tmp/graph.png")