private void refreshPlot()
        {
            plotChart.Series.Clear();

            // Add series for sample values
            Series serie;

            serie           = plotChart.Series.Add("No cluster");
            serie.ChartType = SeriesChartType.Point;
            serie.Color     = Color.Gray;
            for (var cluster = 0; cluster < nbClusters; cluster++)
            {
                serie           = plotChart.Series.Add("Cluster #" + cluster);
                serie.ChartType = SeriesChartType.Point;
            }

            double xmin = double.PositiveInfinity;
            double xmax = 0;
            double ymin = double.PositiveInfinity;
            double ymax = 0;

            for (var i = 0; i < samples.GetLength(1); i++)
            {
                for (var j = 0; j < samples.GetLength(2); j++)
                {
                    var inputs = evaluator.GetInputs(i, j).ToArray();

                    var x = inputs[currentDimensionIdx];
                    var y = inputs[(currentDimensionIdx + 1) % nbInputs];

                    int    selectedCluster = 0;
                    double maxActivation   = 0.0;
                    for (int cluster = 0; cluster < nbClusters; cluster++)
                    {
                        if (outputs[cluster, i, j] > maxActivation)
                        {
                            selectedCluster = cluster;
                            maxActivation   = outputs[cluster, i, j];
                        }
                    }

                    if (x < xmin)
                    {
                        xmin = x;
                    }
                    if (x > xmax)
                    {
                        xmax = x;
                    }
                    if (y < ymin)
                    {
                        ymin = y;
                    }
                    if (y > ymax)
                    {
                        ymax = y;
                    }

                    plotChart.Series[maxActivation > 0 ? selectedCluster + 1 : 0].Points.AddXY(x, y);
                }
            }

            plotChart.ChartAreas[0].AxisX.Minimum = xmin;
            plotChart.ChartAreas[0].AxisX.Maximum = xmax;
            plotChart.ChartAreas[0].AxisY.Minimum = ymin;
            plotChart.ChartAreas[0].AxisY.Maximum = xmax;
        }