On this page:
7.1 Compatibility
plot-deprecation-warnings?
7.2 Output
plot-new-window?
plot-width
plot-height
plot-jpeg-quality
plot-ps/ pdf-interactive?
7.3 Axis Transforms
plot-x-transform
plot-y-transform
plot-z-transform
id-transform
log-transform
cbrt-transform
hand-drawn-transform
7.4 General Appearance
plot-foreground
plot-background
plot-foreground-alpha
plot-background-alpha
plot-font-size
plot-font-family
plot-line-width
plot-legend-anchor
plot-legend-box-alpha
plot-tick-size
plot-title
plot-x-label
plot-y-label
plot-z-label
plot-animating?
7.5 Lines
line-samples
line-color
line-width
line-style
line-alpha
7.6 Intervals
interval-color
interval-style
interval-line1-color
interval-line1-width
interval-line1-style
interval-line2-color
interval-line2-width
interval-line2-style
interval-alpha
7.7 Points
point-sym
point-color
point-size
point-line-width
point-alpha
7.8 Vector Fields
vector-field-samples
vector-field-color
vector-field-line-width
vector-field-line-style
vector-field-scale
vector-field-alpha
7.9 Error Bars
error-bar-width
error-bar-color
error-bar-line-width
error-bar-line-style
error-bar-alpha
7.10 Contours and Contour Intervals
default-contour-colors
default-contour-fill-colors
contour-samples
contour-levels
contour-colors
contour-widths
contour-styles
contour-alphas
contour-interval-colors
contour-interval-styles
contour-interval-alphas
7.11 Rectangles
rectangle-color
rectangle-style
rectangle-line-color
rectangle-line-width
rectangle-line-style
rectangle-alpha
rectangle3d-line-width
discrete-histogram-gap
7.12 Decorations
x-axis-ticks?
y-axis-ticks?
z-axis-ticks?
polar-axes-number
polar-axes-ticks?
label-anchor
label-angle
label-alpha
label-point-size
7.13 3D General Appearance
plot3d-samples
plot3d-angle
plot3d-altitude
plot3d-ambient-light
plot3d-diffuse-light?
plot3d-specular-light?
7.14 Surfaces
surface-color
surface-style
surface-line-color
surface-line-width
surface-line-style
surface-alpha
7.15 Contour Surfaces
contour-interval-line-colors
contour-interval-line-widths
contour-interval-line-styles
7.16 Isosurfaces
default-isosurface-colors
default-isosurface-line-colors
isosurface-levels
isosurface-colors
isosurface-line-colors
isosurface-line-widths
isosurface-line-styles
isosurface-alphas
Version: 5.2

7 Plot and Renderer Parameters

7.1 Compatibility

(plot-deprecation-warnings?)  boolean?
(plot-deprecation-warnings? warnings?)  void?
  warnings? : boolean?

=

#f

When #t, prints a deprecation warning to current-error-port on the first use of mix, line, contour, shade, surface, or a keyword argument of plot or plot3d that exists solely for backward compatibility.

7.2 Output

(plot-new-window?)  boolean?
(plot-new-window? window?)  void?
  window? : boolean?

=

#f

When #t, plot and plot3d open a new window for each plot instead of returning an image-snip%.

Users of command-line Racket, which cannot display image snips, should enter
before using plot or plot3d.

The width and height of a plot, in logical drawing units (e.g. pixels for bitmap plots).

(plot-jpeg-quality)  (integer-in 0 100)
(plot-jpeg-quality quality)  void?
  quality : (integer-in 0 100)

=

100

The quality of JPEG images written by plot-file and plot3d-file. See save-file.

(plot-ps/pdf-interactive?)  boolean?
(plot-ps/pdf-interactive? interactive?)  void?
  interactive? : boolean?

=

#f

If #t, plot-file and plot3d-file open a dialog when writing PostScript or PDF files. See post-script-dc% and pdf-dc%.

7.3 Axis Transforms

Per-axis, nonlinear transforms. Set these, for example, to plot with log-scale axes. See log-transform.

(id-transform x-min x-max)  invertible-function?
  x-min : real?
  x-max : real?
The default transform for all axes.

(log-transform x-min x-max)  invertible-function?
  x-min : real?
  x-max : real?
A log transform. Use this to generate plots with log-scale axes. Any log-scaled axis must be on a positive interval.

Examples:

> (parameterize ([plot-y-transform  log-transform])
    (plot (function (λ (x) x) 0.01 1)))

image

> (parameterize ([plot-x-transform  log-transform])
    (plot (function (λ (x) x) -1 1)))

log-transform: expects type <positive real> as 1st

argument, given: -1; other arguments were: 1

(cbrt-transform x-min x-max)  invertible-function?
  x-min : real?
  x-max : real?
A "cube-root" transform. Unlike the log transform, it is defined on the entire real line, making it better for testing the appearance of plots with nonlinearly transformed axes.

(hand-drawn-transform freq)
  (real? real? . -> . invertible-function?)
  freq : (>/c 0)
An extremely important test case, which makes sure that PLoT can use any monotone, invertible function as an axis transform.

The freq parameter controls the “shakiness” of the transform. At high values, it makes plots look like Peanuts cartoons. For example,

> (parameterize ([plot-x-transform  (hand-drawn-transform 200)]
                 [plot-y-transform  (hand-drawn-transform 200)])
    (plot (function sqr -1 1)))

image

7.4 General Appearance

(plot-foreground)  plot-color/c
(plot-foreground color)  void?
  color : plot-color/c

=

0

(plot-background)  plot-color/c
(plot-background color)  void?
  color : plot-color/c

=

0

The plot foreground and background color. That both are 0 by default is not a mistake: for foreground colors, 0 is interpreted as black; for background colors, 0 is interpreted as white. See ->pen-color and ->brush-color for details on how PLoT interprets integer colors.

(plot-foreground-alpha)  (real-in 0 1)
(plot-foreground-alpha alpha)  void?
  alpha : (real-in 0 1)

=

1

(plot-background-alpha)  (real-in 0 1)
(plot-background-alpha alpha)  void?
  alpha : (real-in 0 1)

=

1

The opacity of the background and foreground colors.

(plot-font-size)  (>=/c 0)
(plot-font-size size)  void?
  size : (>=/c 0)

=

11

The font size of the title, axis labels, tick labels, and other labels, in drawing units.

(plot-font-family)  font-family/c
(plot-font-family family)  void?
  family : font-family/c

=

'roman

The font family used for the title and labels.

(plot-line-width)  (>=/c 0)
(plot-line-width width)  void?
  width : (>=/c 0)

=

1

The width of axis lines and major tick lines. (Minor tick lines are half this width.)

(plot-legend-anchor)  anchor/c
(plot-legend-anchor anchor)  void?
  anchor : anchor/c

=

'top-right

Controls the placement of the legend.

(plot-legend-box-alpha)  (real-in 0 1)
(plot-legend-box-alpha alpha)  void?
  alpha : (real-in 0 1)

=

2/3

The opacity of the filled rectangle behind the legend entries.

(plot-tick-size)  (>=/c 0)
(plot-tick-size size)  void?
  size : (>=/c 0)

=

10

The length of tick lines, in drawing units.

(plot-title)  (or/c string? #f)
(plot-title title)  void?
  title : (or/c string? #f)

=

#f

(plot-x-label)  (or/c string? #f)
(plot-x-label label)  void?
  label : (or/c string? #f)

=

"x axis"

(plot-y-label)  (or/c string? #f)
(plot-y-label label)  void?
  label : (or/c string? #f)

=

"y axis"

(plot-z-label)  (or/c string? #f)
(plot-z-label label)  void?
  label : (or/c string? #f)

=

#f

The title and axis labels. A #f value means the label is not drawn and takes no space. A "" value effectively means the label is not drawn, but it takes space.

(plot-animating?)  boolean?
(plot-animating? animating?)  void?
  animating? : boolean?

=

#f

When #t, certain renderers draw simplified plots to speed up drawing. PLoT sets it to #t, for example, when a user is clicking and dragging a 3D plot to rotate it.

7.5 Lines

(line-samples)  (and/c exact-integer? (>=/c 2))
(line-samples samples)  void?
  samples : (and/c exact-integer? (>=/c 2))

=

500

(line-color)  plot-color/c
(line-color color)  void?
  color : plot-color/c

=

1

(line-width)  (>=/c 0)
(line-width width)  void?
  width : (>=/c 0)

=

1

(line-style)  plot-pen-style/c
(line-style style)  void?
  style : plot-pen-style/c

=

'solid

(line-alpha)  (real-in 0 1)
(line-alpha alpha)  void?
  alpha : (real-in 0 1)

=

1

7.6 Intervals

(interval-color)  plot-color/c
(interval-color color)  void?
  color : plot-color/c

=

3

(interval-style)  plot-brush-style/c
(interval-style style)  void?
  style : plot-brush-style/c

=

'solid

(interval-line1-width)  (>=/c 0)
(interval-line1-width width)  void?
  width : (>=/c 0)

=

1

(interval-line2-width)  (>=/c 0)
(interval-line2-width width)  void?
  width : (>=/c 0)

=

1

(interval-alpha)  (real-in 0 1)
(interval-alpha alpha)  void?
  alpha : (real-in 0 1)

=

3/4

7.7 Points

(point-sym)  point-sym/c
(point-sym sym)  void?
  sym : point-sym/c

=

'circle

(point-color)  plot-color/c
(point-color color)  void?
  color : plot-color/c

=

0

(point-size)  (>=/c 0)
(point-size size)  void?
  size : (>=/c 0)

=

6

(point-line-width)  (>=/c 0)
(point-line-width width)  void?
  width : (>=/c 0)

=

1

(point-alpha)  (real-in 0 1)
(point-alpha alpha)  void?
  alpha : (real-in 0 1)

=

1

7.8 Vector Fields

(vector-field-line-width)  (>=/c 0)
(vector-field-line-width width)  void?
  width : (>=/c 0)

=

2/3

(vector-field-scale)
  (or/c real? (one-of/c 'auto 'normalized))
(vector-field-scale scale)  void?
  scale : (or/c real? (one-of/c 'auto 'normalized))

=

'auto

(vector-field-alpha)  (real-in 0 1)
(vector-field-alpha alpha)  void?
  alpha : (real-in 0 1)

=

1

7.9 Error Bars

(error-bar-width)  (>=/c 0)
(error-bar-width width)  void?
  width : (>=/c 0)

=

6

(error-bar-color)  plot-color/c
(error-bar-color color)  void?
  color : plot-color/c

=

0

(error-bar-line-width)  (>=/c 0)
(error-bar-line-width width)  void?
  width : (>=/c 0)

=

1

(error-bar-alpha)  (real-in 0 1)
(error-bar-alpha alpha)  void?
  alpha : (real-in 0 1)

=

2/3

7.10 Contours and Contour Intervals

(contour-samples)  (and/c exact-integer? (>=/c 2))
(contour-samples samples)  void?
  samples : (and/c exact-integer? (>=/c 2))

=

51

(contour-levels)
  (or/c 'auto exact-positive-integer? (listof real?))
(contour-levels levels)  void?
  levels : (or/c 'auto exact-positive-integer? (listof real?))

=

'auto

(contour-widths)  pen-widths/c
(contour-widths widths)  void?
  widths : pen-widths/c

=

'(1)

(contour-styles)  plot-pen-styles/c
(contour-styles styles)  void?
  styles : plot-pen-styles/c

=

'(solid long-dash)

(contour-alphas)  alphas/c
(contour-alphas alphas)  void?
  alphas : alphas/c

=

'(1)

(contour-interval-alphas)  alphas/c
(contour-interval-alphas alphas)  void?
  alphas : alphas/c

=

'(1)

7.11 Rectangles

(rectangle-color)  plot-color/c
(rectangle-color color)  void?
  color : plot-color/c

=

3

(rectangle-line-width)  (>=/c 0)
(rectangle-line-width width)  void?
  width : (>=/c 0)

=

1

(rectangle-alpha)  (real-in 0 1)
(rectangle-alpha alpha)  void?
  alpha : (real-in 0 1)

=

1

(rectangle3d-line-width)  (>=/c 0)
(rectangle3d-line-width width)  void?
  width : (>=/c 0)

=

1/3

(discrete-histogram-gap)  (real-in 0 1)
(discrete-histogram-gap gap)  void?
  gap : (real-in 0 1)

=

1/8

7.12 Decorations

These parameters do not control the typical appearance of plots. Instead, they control the look of renderers that add specific decorations, such as labeled points.

(x-axis-ticks?)  boolean?
(x-axis-ticks? ticks?)  void?
  ticks? : boolean?

=

#t

(y-axis-ticks?)  boolean?
(y-axis-ticks? ticks?)  void?
  ticks? : boolean?

=

#t

(z-axis-ticks?)  boolean?
(z-axis-ticks? ticks?)  void?
  ticks? : boolean?

=

#t

(polar-axes-ticks?)  boolean?
(polar-axes-ticks? ticks?)  void?
  ticks? : boolean?

=

#t

(label-anchor)  anchor/c
(label-anchor anchor)  void?
  anchor : anchor/c

=

'left

(label-angle)  real?
(label-angle angle)  void?
  angle : real?

=

0

(label-alpha)  (real-in 0 1)
(label-alpha alpha)  void?
  alpha : (real-in 0 1)

=

1

(label-point-size)  (>=/c 0)
(label-point-size size)  void?
  size : (>=/c 0)

=

4

7.13 3D General Appearance

(plot3d-samples)  (and/c exact-integer? (>=/c 2))
(plot3d-samples samples)  void?
  samples : (and/c exact-integer? (>=/c 2))

=

41

(plot3d-angle)  real?
(plot3d-angle angle)  void?
  angle : real?

=

30

(plot3d-altitude)  real?
(plot3d-altitude altitude)  void?
  altitude : real?

=

60

(plot3d-ambient-light)  (real-in 0 1)
(plot3d-ambient-light light)  void?
  light : (real-in 0 1)

=

2/3

(plot3d-diffuse-light?)  boolean?
(plot3d-diffuse-light? light?)  void?
  light? : boolean?

=

#t

(plot3d-specular-light?)  boolean?
(plot3d-specular-light? light?)  void?
  light? : boolean?

=

#t

7.14 Surfaces

(surface-color)  plot-color/c
(surface-color color)  void?
  color : plot-color/c

=

0

(surface-style)  plot-brush-style/c
(surface-style style)  void?
  style : plot-brush-style/c

=

'solid

(surface-line-width)  (>=/c 0)
(surface-line-width width)  void?
  width : (>=/c 0)

=

1/3

(surface-alpha)  (real-in 0 1)
(surface-alpha alpha)  void?
  alpha : (real-in 0 1)

=

1

7.15 Contour Surfaces

Contour surface renderers use shared contour parameters except for the following three.

7.16 Isosurfaces

Single isosurfaces (isosurface3d) use surface parameters. Nested isosurfaces (isosurfaces3d) use the following.

(isosurface-alphas)  alphas/c
(isosurface-alphas alphas)  void?
  alphas : alphas/c

=

'(1/2)