Forum archive 2000-2006

Michael Gage - plot_list

Michael Gage - plot_list

by Arnold Pizer -
Number of replies: 0
inactiveTopicplot_list topic started 8/28/2001; 8:31:13 PM
last post 8/28/2001; 8:31:13 PM
userMichael Gage - plot_list  blueArrow
8/28/2001; 8:31:13 PM (reads: 1879, responses: 0)


Plots a piecewise linear non-parametric curve through a sequence of points.


$fun = plot_list([x0,y0,x1,y1,...]);

$fun = plot_list([(x0,y0),(x1,y1),...]);

$fun = plot_list(\@x_y_array);

$fun = plot_list([x0,x1,x2...], [y0,y1,y2,...]);

$fun = plot_list(\@xarray,\@yarray);


Arguments are either a reference to a single array of (x,y) pairs, or references to two pairs of arrays, containing the x values and y values respectively. The x values should be strictly increasing.


A reference to a function subroutine which accepts a single x argument and returns a y value. The domain of the function is the closed interval between the lowest and highest x values


$fun = plot_list([(0,1), (1,4), (2,0) ]); # stores a reference to a piecewise linear function in $fun.
$y = &$fun(1.5); # calculates the value of the interpolating piecewise linear function at x=1.5


This macro is defined in


<| Post or View Comments |>