aes
fit
bar
col
8.18
top
← prev up next →

Graphite: A data visualization libraryπŸ”— i

Tulip Amalie <tulip@bicompact.space>

Graphite is a library designed for producing specific kinds of common graphs/plots, while making decisions about the data being plotted. Graphite is designed to switch between different types of plots relatively seamlessly, without changing anything about the underlying data’s structure.

Graphite is built on top of, and does not replace, plot. For many applications (e.g. 3D plotting, continuous data, interactive plots, etc), plot will be a far better fit.

All of the data-sets that are referred to in this documentation (organdata, oecd, etc) are available here.

A tutorial on graphite is also available; Graphite: a guided tour.

1Graphing ProceduresπŸ”— i

procedure

( graph #:datadata
#:mappingmapping
[ #:widthwidth
#:heightheight
#:titletitle
#:x-labelx-label
#:x-transformx-transform
#:x-convx-conv
#:x-minx-min
#:x-maxx-max
#:y-labely-label
#:y-transformy-transform
#:y-convy-conv
#:y-miny-min
#:y-maxy-max
#:facet-wrapfacet-wrap
#:legend-anchorlegend-anchor
#:themetheme]
renderer...)pict?
mapping:aes?
width:(or/c rational? #f)=(plot-width )
height:(or/c rational? #f)=(plot-height )
title:(or/c string? pict? #f)=(plot-title )
x-label:(or/c string? pict? #f)=#f
x-transform:(or/c transform? #f)=#f
x-conv:(or/c (-> any/c real? )#f)=#f
x-min:(or/c rational? #f)=#f
x-max:(or/c rational? #f)=#f
y-label:(or/c string? pict? #f)=#f
y-transform:(or/c transform? #f)=#f
y-conv:(or/c (-> any/c real? )#f)=#f
y-min:(or/c rational? #f)=#f
y-max:(or/c rational? #f)=#f
facet-wrap:(or/c positive-integer? #f)=#f
The primary graphing procedure, producing a pict? . All positional arguments are graphite-renderer? s to be plotted, as returned by points , histogram , et cetera.

The required argument #:data takes a data-frame? , as provided by the data-frame library. Note that the data being fed in must be tidy, meaning that:
  • Every column is a variable.

  • Every row is an observation.

  • Every cell is a single value.

The required argument #:mapping takes a aes? that dictates aesthetics to be applied to every renderer in the specified tree. Generally, you will want at least an x-axis (#:x).

The #:x-conv and #:y-conv arguments, if given, perform pre-processing of the x-axis and y-axis variable (when said variables are not automatically determined). For example, if you wanted to place dates on the x-axis, this could be a function converting your preferred date format to seconds since the UNIX epoch.

The #:x-transform and #:y-transform arguments, if given, take a transform? to adjust the x and y axes, as well as the ticks. For example, if you wanted to place a logarithmic transform on the x-axis, you could specify logarithmic-transform . Transforms are applied after the respective #:x-conv or #:y-conv function, if present.

When given, the #:x-min (etc.) arguments determine the bounds of the plot, but not the bounds of the individual renderers. For this, the data should be trimmed before being passed in.

The aesthetic #:facet, specified in the #:mapping argument, dictates whether to facet on a single categorical variable. If this is selected, Graphite will split the plot into subplots based on that variable, into a grid. This aesthetic will cause unexpected behavior if not applied globally.

The optional #:facet-wrap argument dictates how many columns should be drawn before wrapping to a new line. By default, this is the square root of the number of observations in the #:facet variable, creating a grid.

procedure

( save-pict pictpath)void?

pict:pict?
Saves a pict? to disk, at the given path. Supports saving as PNG, PDF, or SVG, depending on the file extension.

2Aesthetic MappingsπŸ”— i

Aesthetic mappings are used to map a given "aesthetic" (such as the x-axis, y-axis, or color) to a variable. When doing this, the given aesthetic will be "split" on that variable. Every renderer, as well as graph , takes an aesthetic mapping using the #:mapping keyword.

procedure

( aes #:<key>value...)aes?

value:any/c
Creates an aesthetic mapping, with each #:<key> being mapped to each value.

These objects are generally passed with the #:mapping keyword to either the graph procedure or to each individual graphite-renderer? in the render tree. They dictate various aesthetics, dictating how to display the data (such as colors, variables, et cetera), with behavior being dictated by each renderer.

procedure

( aes? v)boolean?

v:any/c
Determines if the input is an aesthetic mapping.

procedure

( aes-with/c #:<key>contract...)contract?

contract:contract?
Determines if the aesthetic mapping has each #:<key>, with each value satisfying the given contract.

procedure

( aes-containing/c #:<key>contract...)contract?

contract:contract?
Determines if the aesthetic mapping optionally contains each #:<key>, and if it does, that each value satisfies the given contract.

3RenderersπŸ”— i

struct

(struct graphite-renderer (functionmetadata))

metadata:(listof (cons/c parameter? any/c ))
The result of each renderer.

Contains both a thunk returning a plot render tree, and an association list of parameters (generally plot parameters) to values, used when a renderer requires certain parameters to be set.

procedure

( points [ #:x-minx-min
#:x-maxx-max
#:y-miny-min
#:y-maxy-max
#:symsym
#:colorcolor
#:fill-colorfill-color
#:x-jitterx-jitter
#:y-jittery-jitter
#:sizesize
#:line-widthline-width
#:alphaalpha
#:labellabel
#:mappinglocal-mapping])graphite-renderer?
x-min:(or/c rational? #f)=#f
x-max:(or/c rational? #f)=#f
y-min:(or/c rational? #f)=#f
y-max:(or/c rational? #f)=#f
fill-color:(or/c plot-color/c 'auto)='auto
x-jitter:(>=/c 0)=(point-x-jitter )
y-jitter:(>=/c 0)=(point-y-jitter )
size:(>=/c 0)=(point-size )
line-width:(>=/c 0)=(point-line-width )
alpha:(real-in 01)=(point-alpha )
label:(or/c string? pict? #f)=#f
local-mapping :
#:ystring?
#:facet(or/c string? #f)
#:discrete-color(or/c string? #f)
#:continuous-color(or/c string? #f))
= (aes )
Returns a renderer that draws a set of points, useful for drawing scatterplots or dot-plots. One of the x/y axes (but not both) can be a qualitative variable, in which case a dot-plot is drawn.

Examples:
> (define (random-data)
(build-vector 50(λ (_ )(random -5050))))
> (df-add-series! df(make-series "x-var"#:data(random-data)))
> (df-add-series! df(make-series "y-var"#:data(random-data)))
> (graph #:datadf
#:mapping(aes #:x"x-var"#:y"y-var")
(points ))
> (graph #:dataorgandata
#:mapping(aes #:x"donors"#:y"country")
(points ))

The optional #:discrete-color aesthetic dictates a variable to split on by color, in discrete groups.

Similarly, the #:continuous-color aesthetic dictates a continuous (numeric) variable to split on by color. You likely want to use a continuous colormap (see theme-continuous ) for this. Legends for continuous colors are not currently supported. We are working on it.

procedure

( fit [ #:x-minx-min
#:x-maxx-max
#:y-miny-min
#:y-maxy-max
#:samplessamples
#:colorcolor
#:widthwidth
#:stylestyle
#:alphaalpha
#:labellabel
#:methodmethod
#:spanspan
#:degreedegree
#:show-equation?show-equation?
#:mappinglocal-mapping])graphite-renderer?
x-min:(or/c rational? #f)=#f
x-max:(or/c rational? #f)=#f
y-min:(or/c rational? #f)=#f
y-max:(or/c rational? #f)=#f
width:(>=/c 0)=(line-width )
alpha:(real-in 01)=(line-alpha )
label:(or/c string? pict? #f)=#f
method:(or/c 'poly'loess)='poly
span:(real-in 01)=span
show-equation?:boolean? =#f
local-mapping :
#:ystring?
#:facet(or/c string? #f))
= (aes )
Makes a line of best fit. Internally, this uses the simple-polynomial library’s best fit method for the default 'poly method, or loess for the 'loess method.

Examples:
> (define noise'(1/9-1/701/3-11/9))
> (df-add-series! df(make-series "x-var"#:data(build-vector 6add1 )))
(make-series "y-var"
#:data(build-vector 6(λ (x)(+ x(list-ref noisex))))))
> (graph #:datadf
#:mapping(aes #:x"x-var"#:y"y-var")
(points )
(fit #:width3#:label"Linear")
(fit #:method'loess#:color'red#:style'dot
#:width3#:label"LOESS"))

The optional #:degree argument specifies the degree of the fit line (2 for a second-degree polynomial, et cetera) in the case of the 'poly method, or the degree of each local fit in the case of 'loess.

See the documentation for loess-fit for details on the #:span parameter.

The optional #:show-equation? argument specifies whether to show the full fit equation in the legend. As LOESS is a non-parametric fit, this requires the 'poly method.

procedure

( lines [ #:x-minx-min
#:x-maxx-max
#:y-miny-min
#:y-maxy-max
#:colorcolor
#:widthwidth
#:stylestyle
#:alphaalpha
#:labellabel
#:mappinglocal-mapping])graphite-renderer?
x-min:(or/c rational? #f)=#f
x-max:(or/c rational? #f)=#f
y-min:(or/c rational? #f)=#f
y-max:(or/c rational? #f)=#f
width:(>=/c 0)=(line-width )
alpha:(real-in 01)=(line-alpha )
label:(or/c string? pict? #f)=#f
local-mapping :
#:ystring?
#:facet(or/c string? #f)
#:discrete-color(or/c string? #f))
= (aes )
Renders some lines connecting the points of the input sequence. This is useful for plotting a time series.

As an example, consider a random walk, adapted from the plot documentation:
> (define-values (xsys)
(for/fold ([xs(list 0)][ys(list 0)])
([i(in-range 1200)])
(values (cons ixs)(cons (+ (first ys)(* 1/100(- (random )1/2)))ys))))
> (df-add-series! df(make-series "x-var"#:data(list->vector xs)))
> (df-add-series! df(make-series "y-var"#:data(list->vector ys)))
> (graph #:datadf
#:mapping(aes #:x"x-var"#:y"y-var")
(lines #:label"Random walk"))

procedure

( error-bars #:mappinglocal-mapping
[ #:x-minx-min
#:x-maxx-max
#:y-miny-min
#:y-maxy-max
#:colorcolor
#:line-widthline-width
#:line-styleline-style
#:widthwidth
#:alphaalpha
#:invert?invert?])graphite-renderer?
local-mapping :
(and/c (aes-with/c #:perc-error?string? )
#:ystring?
#:facet(or/c string? #f)))
x-min:(or/c rational? #f)=#f
x-max:(or/c rational? #f)=#f
y-min:(or/c rational? #f)=#f
y-max:(or/c rational? #f)=#f
line-width:(>=/c 0)=(error-bar-line-width )
width:(>=/c 0)=(error-bar-width )
alpha:(real-in 01)=(error-bar-alpha )
invert?:boolean? =#f
Displays a set of error bars.

The mandatory aesthetic #:perc-error? dictates the variable in the data-frame that corresponds to percent error. The procedure df-add-derived! may be useful for adding this to a data-frame.

For exmaple, with a constant 20% error:
> (define (3x^2x)(* 3.0(expt x2.0)))
> (define (add-errory)(+ y(* y(/ (- (random 4)2)10.0))))
(make-series "3x^2"
#:data(build-vector 10(compose add-error3x^2add1 ))))
> (df-add-series! df(make-series "err"#:data(make-vector 100.2)))
> (graph #:datadf
#:mapping(aes #:x"x"#:y"3x^2")
(points )
(fit #:degree2)
(error-bars #:mapping(aes #:perc-error"err")))

procedure

( bar [ #:x-minx-min
#:x-maxx-max
#:y-miny-min
#:y-maxy-max
#:gapgap
#:skipskip
#:invert?invert?
#:colorcolor
#:stylestyle
#:line-colorline-color
#:line-widthline-width
#:line-styleline-style
#:alphaalpha
#:labellabel
#:add-ticks?add-ticks?
#:far-ticks?far-ticks?
#:modemode
#:group-gapgroup-gap
#:mappinglocal-mapping])graphite-renderer?
x-min:(or/c rational? #f)=0
x-max:(or/c rational? #f)=#f
y-min:(or/c rational? #f)=0
y-max:(or/c rational? #f)=#f
line-width:(>=/c 0)=(rectangle-line-width )
alpha:(real-in 01)=(rectangle-alpha )
label:(or/c string? pict? #f)=#f
add-ticks?:boolean? =#t
far-ticks?:boolean? =#f
mode:(or/c 'count'prop)='count
group-gap:(>=/c 0)=1
local-mapping :
#:facet(or/c string? #f)
#:group(or/c string? #f))
= (aes )
Renders a bar chart, with calculations done on the data before plotting. For plotting literal data as bars, see col .

The #:mode argument dictates whether the y-axis should be the count of observations by the x-axis ('count), or the relative frequency of those observations ('prop).

The optional #:group aesthetic dictates whether the bar should be "dodged", with each bar being broken up into bars based on the group. If this is enabled, the #:group-gap argument dictates the space between each sub-chart.

procedure

( stacked-bar [ #:x-minx-min
#:x-maxx-max
#:y-miny-min
#:y-maxy-max
#:gapgap
#:skipskip
#:invert?invert?
#:colorscolors
#:stylesstyles
#:line-colorsline-colors
#:line-widthsline-widths
#:line-stylesline-styles
#:alphasalphas
#:labelslabels
#:add-ticks?add-ticks?
#:far-ticks?far-ticks?
#:modemode
#:mappinglocal-mapping])graphite-renderer?
x-min:(or/c rational? #f)=#f
x-max:(or/c rational? #f)=#f
y-min:(or/c rational? #f)=0
y-max:(or/c rational? #f)=#f
labels:(labels/c nat/c )='(#f)
add-ticks?:boolean? =#t
far-ticks?:boolean? =#f
mode:(or/c 'count'prop)='count
local-mapping :
#:facet(or/c string? #f)
#:groupstring? )
= (aes )
Renders a stacked bar chart, stratified by group.

The mandatory #:group aesthetic dictates what variable each bar should be broken up by.

The #:mode argument dictates whether the y-axis should be the count of observations by the x-axis ('count), or the relative frequency of those observations ('prop). 'prop does not make much sense for stacked bar charts (everything is 100% of itself), but it can be useful in some scenarios.

procedure

( col [ #:x-minx-min
#:x-maxx-max
#:y-miny-min
#:y-maxy-max
#:colorcolor
#:stylestyle
#:line-colorline-color
#:line-widthline-width
#:line-styleline-style
#:alphaalpha
#:labellabel
#:gapgap
#:baselinebaseline
#:mappinglocal-mapping])graphite-renderer?
x-min:(or/c rational? #f)=#f
x-max:(or/c rational? #f)=#f
y-min:(or/c rational? #f)=#f
y-max:(or/c rational? #f)=#f
line-width:(>=/c 0)=(rectangle-line-width )
alpha:(real-in 01)=(rectangle-alpha )
label:(or/c string? pict? #f)=#f
gap:real? =0
baseline:real? =0
local-mapping :
#:ystring?
#:discrete-color(or/c string? #f)
#:facet(or/c string? #f))
= (aes )
Renders a bar chart. Unlike bar , this treats the specified x and y variables as a collection of variables to be directly displayed, rather than doing further calculations (counting/proportions). The x-axis can be a qualitative variable, but the y-axis must be quantitative.

The optional #:gap argument specifies the gap between each bar.

The optional #:baseline argument specifies the baseline of the "x-axis". For example, if you wanted all columns with values above 20 to be above the "x-axis", and all below 20 to be below it, you would set this to be 20.

Examples:
> (define simple(make-data-frame ))
> (df-add-series! simple(make-series "trt"#:data(vector "a""b""c")))
> (df-add-series! simple(make-series "outcome"#:data(vector 2.31.93.2)))
> (graph #:datasimple
#:mapping(aes #:x"trt"#:y"outcome")
(col #:gap0.25))
> (graph #:dataoecd
#:mapping(aes #:x"year"#:y"diff")
#:title"Difference between US and OECD average life expectancies"
#:x-label"Year"#:y-label"Difference (years)"
#:y-min-2#:y-max2
#:width600#:height400
#:legend-anchor'no-legend
(col #:mapping(aes #:discrete-color"hi_lo")))

procedure

( histogram [ #:x-minx-min
#:x-maxx-max
#:y-miny-min
#:y-maxy-max
#:colorcolor
#:stylestyle
#:line-colorline-color
#:line-widthline-width
#:line-styleline-style
#:alphaalpha
#:labellabel
#:binsbins
#:mappinglocal-mapping])graphite-renderer?
x-min:(or/c rational? #f)=#f
x-max:(or/c rational? #f)=#f
y-min:(or/c rational? #f)=#f
y-max:(or/c rational? #f)=#f
line-width:(>=/c 0)=(rectangle-line-width )
alpha:(real-in 01)=(rectangle-alpha )
label:(or/c string? pict? #f)=#f
local-mapping :
#:y(or/c string? #f)
#:facet(or/c string? #f))
= (aes )
Renders a histogram. This is not the same as a bar chart, as the x-axis must be a continuous variable.

The argument #:bins dictates the number of bins on the x-axis.

The optional #:y aesthetic will be the average of every observation in the given x-axis bin. If not specified, this will default to the count of the number of elements in the bin. Anecdotally, if you use this, you may be better off with points or lines .

procedure

( density [ #:x-minx-min
#:x-maxx-max
#:y-miny-min
#:y-maxy-max
#:samplessamples
#:colorcolor
#:widthwidth
#:stylestyle
#:alphaalpha
#:labellabel
#:mappinglocal-mapping])graphite-renderer?
x-min:(or/c rational? #f)=#f
x-max:(or/c rational? #f)=#f
y-min:(or/c rational? #f)=#f
y-max:(or/c rational? #f)=#f
width:(>=/c 0)=(line-width )
alpha:(real-in 01)=(line-alpha )
label:(or/c string? pict? #f)=#f
local-mapping :
#:facet(or/c string? #f)
#:discrete-color(or/c string? #f))
= (aes )
Renders estimated density for the given points. The only suppported kernel is the Gaussian, as this is the only supported kernel in plot.

procedure

( boxplot [ #:invert?invert?
#:iqr-scaleiqr-scale
#:gapgap
#:box-colorbox-color
#:box-stylebox-style
#:box-line-colorbox-line-color
#:box-line-widthbox-line-width
#:box-line-stylebox-line-style
#:box-alphabox-alpha
#:show-outliers?show-outliers?
#:outlier-coloroutlier-color
#:outlier-symoutlier-sym
#:outlier-fill-coloroutlier-fill-color
#:outlier-sizeoutlier-size
#:outlier-line-widthoutlier-line-width
#:outlier-alphaoutlier-alpha
#:show-whiskers?show-whiskers?
#:whiskers-colorwhiskers-color
#:whiskers-widthwhiskers-width
#:whiskers-stylewhiskers-style
#:whiskers-alphawhiskers-alpha
#:show-median?show-median?
#:median-colormedian-color
#:median-widthmedian-width
#:median-stylemedian-style
#:median-alphamedian-alpha
#:mappinglocal-mapping])
invert?:boolean? =#f
iqr-scale:real? =1.5
box-line-width:(>=/c 0)=(rectangle-line-width )
box-alpha:(real-in 01)=(rectangle-alpha )
show-outliers?:boolean? =#t
outlier-color:plot-color/c =(point-color )
outlier-sym:point-sym/c =(point-sym )
outlier-fill-color:(or/c plot-color/c 'auto)='auto
outlier-size:(>=/c 0)=(point-size )
outlier-line-width:(>=/c 0)=(point-line-width )
outlier-alpha:(real-in 01)=(point-alpha )
show-whiskers?:boolean? =#t
whiskers-color:plot-color/c =(line-color )
whiskers-width:(>=/c 0)=(line-width )
whiskers-style:plot-pen-style/c =(line-style )
whiskers-alpha:(real-in 01)=(line-alpha )
show-median?:boolean? =#t
median-color:plot-color/c =(line-color )
median-width:(>=/c 0)=(line-width )
median-style:plot-pen-style/c =(line-style )
median-alpha:(real-in 01)=(line-alpha )
local-mapping :
#:ystring?
#:facet(or/c string? #f))
= (aes )
Renders a box-and-whisker plot. One of the axes (x if not inverted, y if inverted) is assumed to be a qualitative variable.

The optional #:invert? argument, if true, will draw the box-and-whisker plots lengthwise (left-to-right) rather than top-to-bottom. This means that the axes will have to be inverted. For example:
> (graph #:dataorgandata
#:mapping(aes #:x"country"#:y"donors")
(boxplot ))
> (graph #:dataorgandata
#:mapping(aes #:x"donors"#:y"country")
(boxplot #:invert?#t))
where the second graph is wildly preferable.

The optional #:iqr-scale argument is the multiplier used to determine the lower and upper limits (IQR) and which points are considered arguments. These limits are calculated as (* iqr-scale(- Q3Q1)), where Q1 and Q3 are (respectively) the first and third quantile of the data.

4Axis TransformsπŸ”— i

struct

(struct transform (plot-transformaxis-ticks))

plot-transform:axis-transform/c
axis-ticks:ticks?
Represents an axis transform, to be used in the #:x-transform or #:y-transform argument of graph .

Takes a plot transform and a ticks? for the respective axis to be applied. For example, to add a stretch transform on an axis where the x-axis is a date:
> (define iso8601->posix(compose ->posix iso8601->date ))
> (graph #:datachicago
#:mapping(aes #:x"date"#:y"temp")
#:x-transform(transform (stretch-transform
(iso8601->posix"1998-01-01")
(iso8601->posix"1999-01-01")
10)
#:x-conviso8601->posix
#:width600
(points ))

procedure

( get-adjusted-ticks transform)ticks?

transform:transform?
Gets the adjusted ticks? from the axis transform, for actual usage as plot-x-ticks or plot-y-ticks . Useful both internally and for interoperation with plot.

procedure

( only-ticks ticks)transform?

ticks:ticks?
Constructs a new transform that only changes the axis ticks according to the input ticks, without actually manipulating the data.

The dummy axis transform. Does not manipulate the data.

A logarithmic (base 10) axis transform.

5ThemingπŸ”— i

struct

(struct graphite-theme ( foreground
foreground-alpha
background
background-alpha
font-size
font-face
font-family
pen-color-map
brush-color-map))
foreground:plot-color/c
foreground-alpha:(real-in 01)
background:plot-color/c
background-alpha:(real-in 01)
font-size:(>=/c 0)
font-face:(or/c string? #f)
font-family:font-family/c
pen-color-map:(or/c symbol? #f)
brush-color-map:(or/c symbol? #f)
Represents a theme, to be passed by the #:theme argument to graph .

These fields correspond to, respectively, the plot parameters plot-foreground , plot-foreground-alpha , plot-background , plot-background-alpha , plot-font-size , plot-font-face , plot-font-family , plot-pen-color-map , and plot-brush-color-map . They correspond to the same behaviors in plot .

The pen-color-map field corresponds to the color-map used to draw points and lines, such as that in points or lines . The brush-color-map field corresponds to the color-map used to draw rectangles and other large fields, such as histogram and bar .

procedure

( make-graphite-theme [ #:fgfg
#:fg-alphafg-alpha
#:bgbg
#:bg-alphabg-alpha
#:font-sizefont-size
#:font-facefont-face
#:font-familyfont-family
#:color-mapcolor-map
#:brush-color-mapbrush-color-map])
fg-alpha:(real-in 01)=(plot-foreground-alpha )
bg-alpha:(real-in 01)=(plot-background-alpha )
font-size:(>=/c 0)=(plot-font-size )
font-face:(or/c symbol? #f)=(plot-font-face )
color-map:(or/c symbol? #f)=(plot-pen-color-map )
brush-color-map:(or/c symbol? #f)=(plot-brush-color-map )
Constructs a graphite-theme? , but with keyword-arguments for readability, and with fields defaulting to their respective plot parameters.

procedure

( theme-override theme
[ #:fgfg
#:fg-alphafg-alpha
#:bgbg
#:bg-alphabg-alpha
#:font-sizefont-size
#:font-facefont-face
#:font-familyfont-family
#:color-mapcolor-map
#:brush-color-mapbrush-color-map])
fg-alpha : (real-in 01)
bg-alpha : (real-in 01)
font-size:(>=/c 0)=(graphite-theme-font-size theme)
font-face:(>=/c 0)=(graphite-theme-font-face theme)
font-family : font-family/c
color-map : (or/c symbol? #f)
brush-color-map : (or/c symbol? #f)
Constructs a graphite-theme? , but overriding fields from an existing theme. For example, if you wanted to use Comic Sans with the default theme, you could use the theme:

(theme-override theme-default #:font-face"Comic Sans MS")

The default theme. Defined as:
(make-graphite-theme #:fg"black"#:fg-alpha1
#:bg"white"#:bg-alpha1
#:font-size11#:font-family'swiss
#:color-map'set1#:brush-color-map'pastel1)

Uses a sans-serif font, white background, black text, and the 'set1 color-map and 'pastel1 brush color map. See the documentation for plot-pen-color-map for the colors of this theme.

A theme for plotting continuous data. Defined as the default theme, except with the color-map set to 'cb-bupu-9 from the colormaps package.

Examples:
> (df-add-derived! gapminder"log-pop"'("pop")(λ (x)(log (first x)10)))
> (graph #:datagapminder
#:mapping(aes #:x"gdpPercap"#:y"lifeExp")
#:x-transformlogarithmic-transform
#:legend-anchor'no-legend
(points #:mapping(aes #:continuous-color"log-pop")))

procedure

( theme->alist theme)(listof (cons/c parameter? any/c ))

Converts a graphite-theme? to an association list of plot parameters to the values specified by the theme.

top
← prev up next →

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /