O'Reilly logo

Hands-On Machine Learning with C# by Matt R. Cole

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The main Plot function

Behind the scenes, the Plot function is what is responsible for executing and plotting each function:

private void Plot(Func<double, double> fn, string fnName,   Color graphColor, GraphPane gpane = null){  const double xmin = -2.0;  const double xmax = 2.0;  const int resolution = 2000;  zed.IsShowPointValues = true;  zed.PointValueFormat = "e";  var pane = gpane ?? zed.GraphPane;  pane.XAxis.MajorGrid.IsVisible = true;  pane.YAxis.MajorGrid.IsVisible = true;  pane.Title.Text = fnName;  pane.YAxis.Title.Text = string.Empty;  pane.XAxis.Title.Text = string.Empty;  double[] xarr = new double[resolution];  double[] yarr = new double[resolution];  double incr = (xmax - xmin) / resolution;  double x = xmin;for(int i=0; i < resolution;  ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required