Plotting

Uses
- Term classes
- One-dimensional arrays, Function application to one-dimensional arrays
- Tuples
- Real numbers

Plots are represented by terms of the sort PlotLzPlotTerm, with LzPlotTermPharoTermClass. These definitions ensure that plot terms are created as instances of LzPlotTerm LzTermInContext subclass: #LzPlotTerm instanceVariableNames: '' classVariableNames: '' package: 'Leibniz2-Plotting' .

Line plots can be defined by an array of (x, y) pairs:
linePlot(Array1D((ℝ, ℝ))) : Plot
or by separate arrays for x and y values:
linePlot(Array1D(ℝ), Array1D(ℝ)) : Plot

Another possibility is providing a function plus an array of x values:
linePlot(, Array1D(ℝ)) : Plot
The y values are then computed from:
linePlot(f:(), x:Array1D(ℝ)) ⇒ linePlot(x, f[x])

Examples

A line plot for an array of points:
linePlot({[(0, 1), (1, 2), (3, -1), (4, 1/2)]})

A line plot of a function (the squaring function from functionExample Functions/realFunction):
functionExample square[{[1, 2, 3]}] ⇒ {[1, 4, 9]}
functionExample linePlot(square, {[0, 1/2, 1, 3/2, 2, 5/2, 6]})