3 Customizing Plots
(require plot/extend) |
The plot/extend module allows you to create your own constructors, further customize the appearance of the plot windows, and in general extend the package.
(sample-size sample-count x-min x-max) → real? |
sample-count : exact-positive-integer? |
x-min : number |
x-max : number |
Given sample-count, x-min, and x-max, returns the size of each sample.
| |||||||||||||||||||||
vecs : (listof vector?) | |||||||||||||||||||||
x-sample-size : real? | |||||||||||||||||||||
y-sample-size : real? |
Scales vectors, causing them to fit in their boxes.
(x-values sample-count x-min x-max) → (listof real?) |
sample-count : exact-positive-integer? |
x-min : number |
x-max : number |
Given samples, x-min, and x-max, returns a
list of xs spread across the range.
| |||||||||||||||||||||
vec : vector? | |||||||||||||||||||||
x-sample-size : real? | |||||||||||||||||||||
y-sample-size : real? |
Normalizes vec based on x-sample-size and y-sample-size.
| |||||||||||||||||||||
vecs : (listof vector?) | |||||||||||||||||||||
x-sample-size : real? | |||||||||||||||||||||
y-sample-size : real? |
Normalizes vecs based on x-sample-size and y-sample-size.
Given an x and a list of ys, produces a list of
points pairing the x with each of the ys.
(xy-list sample-count x-min x-max y-min y-max) |
→ (listof (listof (vector/c real? real?))) |
sample-count : exact-positive-integer? |
x-min : real? |
x-max : real? |
y-min : real? |
y-max : real? |
Makes a list of all the positions on the graph.
(zgrid f xs ys) → (listof (listof real?)) |
f : (real? real? . -> . real?) |
xs : (listof real?) |
ys : (listof real?) |
Given a function that consumes x and y to produce
z, a list of xs, and a list of ys,
produces a list of z column values.
plot-view% : class? |
superclass: object% |
Returns the minimum plottable x coordinate.Returns the minimum plottable y coordinate.Returns the maximum plottable x coordinate.Returns the maximum plottable y coordinate.
(send a-plot-view set-line-color color) → void? color : plot-color? Sets the drawing color.
(send a-plot-view set-line-width width) → void? width : real? Sets the drawing line width.
2d-view% : class? |
superclass: plot-view% |
Provides an interface to drawing 2-D plots. An instance of
2d-view% is created by plot, and the following
methods can be used to adjust it.
(send a-2d-view set-labels x-label y-label title) → void? x-label : string? y-label : string? title : string? Sets the axis labels and title.
(send a-2d-view plot-vector head tail) → void? head : (vector/c real? real?) tail : (vector/c real? real?) Plots a single vector.
(send a-2d-view plot-vectors vecs) → void?
vecs :
(listof (list/c (vector/c real? real?) (vector/c real? real?))) Plots a set of vectors.
(send a-2d-view plot-points points sym) → void? points : (listof (vector/c real? real?)) sym : (or/c character? integer? symbol?) Plots points using a specified symbol. See points for possible values for symPlots a line given a set of points.
(send a-2d-view plot-contours grid xs ys levels) → void? grid : (listof (listof real?)) xs : (listof real?) ys : (listof real?) levels : (listof real?) Plots a grid representing a 3-D function using contours to distinguish levels.
(send a-2d-view plot-shades grid xs ys levels) → void? grid : (listof (listof real?)) xs : (listof real?) ys : (listof real?) levels : (listof real?) Plots a grid representing a 3-D function using shades to show levels.
3d-view% : class? |
superclass: plot-view% |
Provides an interface to drawing 3-D plots. An instance of
3d-view% is created by plot3d, and the following
methods can be used to adjust it.
(send a-3d-view plot-surface xs ys zs) → void? xs : (listof real?) ys : (listof real?) zs : (listof real?) Plots a grid representing a 3d function in a 3d box, showing only the top of the surface.
(send a-3d-view plot-line xs ys zs) → void? xs : (listof real?) ys : (listof real?) zs : (listof real?) Plots a line in 3-D space.Returns the minimum plottable z coordinate.Returns the maximum plottable z coordinate.Returns the altitude (in degrees) from which the 3-D box is viewed.Returns the azimuthal angle.