8 Plot Contracts
8.1 Convenience Contracts
(treeof ct) → contract? ct : (or/c contract? (any/c . -> . any/c)) =
(or/c ct (listof (recursive-contract (treeof ct))))
Identifies trees of values that meet the contract ct. Used by plot and plot3d to construct the contract for a tree of renderer2d? or renderer3d?.
8.2 Appearance Argument Contracts
anchor/c : contract? =
(one-of/c 'top-left 'top 'top-right 'left 'center 'right 'bottom-left 'bottom 'bottom-right) The contract for anchor arguments and parameters, such as plot-legend-anchor.
The contract for #:color arguments, and parameters such as line-color and surface-color. For the meaning of integer colors, see ->pen-color and ->brush-color.
plot-pen-style/c : contract? =
(or/c exact-integer? (one-of/c 'transparent 'solid 'dot 'long-dash 'short-dash 'dot-dash)) The contract for #:style arguments (when they refer to lines), and paramters such as line-style. For the meaning of integer pen styles, see ->pen-style.
plot-brush-style/c : contract? =
(or/c exact-integer? (one-of/c 'transparent 'solid 'bdiagonal-hatch 'fdiagonal-hatch 'crossdiag-hatch 'horizontal-hatch 'vertical-hatch 'cross-hatch)) The contract for #:style arguments (when they refer to fills), and parameters such as interval-style. For the meaning of integer brush styles, see ->brush-style.
font-family/c : contract? =
(one-of/c 'default 'decorative 'roman 'script 'swiss 'modern 'symbol 'system) Identifies legal font family values. See plot-font-family.
> (require (only-in srfi/13 string-pad-right))
> (for ([sym (in-list known-point-symbols)] [n (in-cycle (in-range 3))]) (display (string-pad-right (format "~v" sym) 22)) (when (= n 2) (newline)))
'dot 'point 'pixel
'plus 'times 'asterisk
'5asterisk 'odot 'oplus
'otimes 'oasterisk 'o5asterisk
'circle 'square 'diamond
'triangle 'fullcircle 'fullsquare
'fulldiamond 'fulltriangle 'triangleup
'triangledown 'triangleleft 'triangleright
'fulltriangleup 'fulltriangledown 'fulltriangleleft
'fulltriangleright 'rightarrow 'leftarrow
'uparrow 'downarrow '4star
'5star '6star '7star
'8star 'full4star 'full5star
'full6star 'full7star 'full8star
'circle1 'circle2 'circle3
'circle4 'circle5 'circle6
'circle7 'circle8 'bullet
'fullcircle1 'fullcircle2 'fullcircle3
'fullcircle4 'fullcircle5 'fullcircle6
'fullcircle7 'fullcircle8
> (length known-point-symbols) 59
8.3 Appearance Argument Sequence Contracts
plot-colors/c : contract? =
(or/c (listof plot-color/c) ((listof real?) . -> . (listof plot-color/c))) The contract for #:colors arguments, as in contours. If the contracted value is a function, it is intended to take a list of values, such as contour values, as input, and return a list of colors. The number of colors need not be the same as the number of values. If shorter, they will cycle; if longer, some will not be used.See color-seq and color-seq* for a demonstration of constructing arguments with this contract.
plot-pen-styles/c : contract? =
(or/c (listof plot-pen-style/c) ((listof real?) . -> . (listof plot-pen-style/c))) Like plot-colors/c, but for line styles.
Like plot-colors/c, but for line widths.
plot-brush-styles/c : contract? =
(or/c (listof plot-brush-style/c) ((listof real?) . -> . (listof plot-brush-style/c))) Like plot-colors/c, but for fill styles.
Like plot-colors/c, but for opacities.