private static DataSeriesBox show(String title, Func<double, double> function, double? min, double? max, double? step, int? npoints)
{
if (min == null || max == null)
{
DoubleRange range;
if (ScatterplotBox.GetRange(function, out range))
{
min = range.Min;
max = range.Max;
}
else
{
min = 0;
max = 1;
}
}
if (npoints == null)
npoints = 1000;
if (step == null)
step = (max - min) / npoints;
double[] input = Vector.Interval(min.Value, max.Value, step.Value);
double[] output = Matrix.Apply(input, function);
return show(title, input, new[] { output });
}