No matching definitions.

plot/line

src/plot/line.tur
defstruct

LinesR

(defstruct LinesR :copy [points : (Vec Point) style : LineStyle label : cstr])

a polyline through its points, in order.

defstruct

FunctionR

(defstruct FunctionR :copy [f : (fn [float])

y = f(x), sampled over [x-min, x-max].

defstruct

ParametricR

(defstruct ParametricR :copy [f : (fn [float])

the point f(t), sampled over [t-min, t-max].

defstruct

PolarR

(defstruct PolarR :copy [f : (fn [float])

radius = f(theta), sampled over [theta-min, theta-max].

defstruct

InverseR

(defstruct InverseR :copy [f : (fn [float])

x = f(y), sampled over [y-min, y-max].

defstruct

DensityR

(defstruct DensityR :copy [values : (Vec float) bandwidth : float samples : int style : LineStyle label : cstr])

a Gaussian kernel density estimate of its sample values; a

defn

function

(function [^fat f : (fn [float])

sample y=f(x) over [x-min, x-max].

fthe curve, a (fn [float] float): a defn or a fn literal
x-minstart of the sampled domain
x-maxend of the sampled domain
samplesuniform baseline sample count
stylethe LineStyle to stroke with
labellegend text ("" for none)

A FunctionR boxed as an AnyRenderer.

(function (fn [x : float] : float (* x x)) -2.0 2.0 96 (default-line-style) "x^2")
defn

lines

(lines [vs : (Vec Point) style : LineStyle label : cstr] :)

draw a polyline through `vs`, in order.

vsthe points
stylethe LineStyle to stroke with
labellegend text ("" for none)

A LinesR boxed as an AnyRenderer.

(lines (vec-of (Point 0.0 0.0) (Point 1.0 2.0)) (default-line-style) "data")
defn

parametric

(parametric [^fat f : (fn [float])

sample the Point f(t).

fthe curve, a (fn [float] Point)
t-minstart of the parameter range
t-maxend of the parameter range
samplesuniform baseline sample count
stylethe LineStyle to stroke with
labellegend text ("" for none)

A ParametricR boxed as an AnyRenderer.

(parametric (fn [t : float] : Point (Point (cos t) (sin t))) 0.0 6.283 128
              (default-line-style) "circle")
defn

polar

(polar [^fat f : (fn [float])

sample radius=f(theta).

fthe radius, a (fn [float] float) of theta
theta-minstart of the angle range, in radians
theta-maxend of the angle range, in radians
samplesuniform baseline sample count
stylethe LineStyle to stroke with
labellegend text ("" for none)

A PolarR boxed as an AnyRenderer.

(polar (fn [t : float] : float 1.0) 0.0 6.283 96 (default-line-style) "r=1")
defn

inverse

(inverse [^fat f : (fn [float])

sample x=f(y) over [y-min, y-max].

fthe curve, a (fn [float] float) of y
y-minstart of the sampled range
y-maxend of the sampled range
samplesuniform baseline sample count
stylethe LineStyle to stroke with
labellegend text ("" for none)

An InverseR boxed as an AnyRenderer.

(inverse (fn [y : float] : float (* y y)) -1.0 1.0 96 (default-line-style) "x=y^2")
defn

density

(density [vs : (Vec float) bandwidth : float samples : int style : LineStyle label : cstr] :)

kernel density estimate of a sample.

vsthe sample values
bandwidthkernel bandwidth; 0.0 picks Silverman's rule
samplesnumber of points the estimate is drawn through
stylethe LineStyle to stroke with
labellegend text ("" for none)

A DensityR boxed as an AnyRenderer.

(density (vec-of 0.5 1.25 1.5 2.75) 0.0 128 (default-line-style) "kde")
Internal definitions
__draw-lines-- stroke a polyline through lowered points, breaking at NaN.
__draw-function-- stroke y = f(x) through the adaptive sampler.
__draw-parametric-- stroke the Point f(t) through the adaptive sampler.
__draw-polar-- stroke radius = f(theta) through the adaptive sampler.
__draw-inverse-- stroke x = f(y) through the adaptive sampler.
__draw-density-- stroke a Gaussian KDE of `values` across the x extent.
Renderer[LinesR]
Renderer[FunctionR]
Renderer[ParametricR]
Renderer[PolarR]
Renderer[InverseR]
Renderer[DensityR]