Plotting

This page is as close as currently exists to reference documentation for gorilla-plot. You might like to first look at the getting started page that has some more usage oriented information about the plot library.

Plot functions

All of these functions are in the gorilla-plot.core namespace.

list-plot

A function for plotting a list of data, used (list-plot data & options). The data can be a sequence of y-values, in which case the x-values will be assumed to run across the integers starting at zero, or a sequence of [x y] pairs. Note that to plot multiple series on the same chart you should compose several list-plots (see below). The options accepted are:

plot

A function for plotting functions, used (plot my-func [xmin xmax] & options). Takes the same options as list-plot, apart from :joined which is always effectively true. Also takes the additional option:

bar-chart

A function for plotting categorical data, used (bar-chart categories values & options), where categories is a list of category labels and values are the values for those categories. Takes the following options, which have the same meaning as for list-plot, :plot-size, :aspect-ratio, :colour, :color, :plot-range, :opacity. Note that bar-charts do not compose well with list-plots and plots, as their x-axis is categorical, not continuous. It’s possible that instead you can use histogram, which does compose with continuous-axes charts.

histogram

Plots a histogram of the data, used (histogram data & options). Data should be a list of numbers. Takes options :plot-range, :plot-size, :aspect-ratio, :colour, :color, :opacity which have the same meaning as above, plus:

compose

Compose is used to show several plots on the same axes. It can be used to produce plots with multiple data series, or to compare line/point plots with histograms. It is used (compose & plots) where plots are one or more of the values returned by the above plotting functions. As noted above, bar-charts do not compose well with other plot types.