163616371638163916401641164216431644
final double step = (end - start) / samples; for (int i = 0; i <= samples; i++) { final double x = start + (step * i); series.add(x, f.getValue(x)); } final XYSeriesCollection collection = new XYSeriesCollection(series); return collection; }