/// <summary>
 /// Shows a new chart in a default form.
 /// </summary>
 /// <param name="pca">A principal component analysis object.</param>
 /// <param name="xIndex">The index of the principal component to use for the x values.</param>
 /// <param name="yIndex">The index of the principal component to use for the y values.</param>
 /// <remarks>
 /// Equivalent to:
 /// <code>
 /// NMathStatsChart.Show( ToChart( pca, xIndex, yIndex ) );
 /// </code>
 /// </remarks>
 public static void Show( DoublePCA pca, int xIndex, int yIndex )
 {
     Show( ToChart( pca, xIndex, yIndex ) );
 }
 /// <summary>
 /// Shows a new chart in a default form.
 /// </summary>
 /// <param name="pca">A principal component analysis object.</param>
 /// <remarks>
 /// Equivalent to:
 /// <code>
 /// NMathStatsChart.Show( ToChart( pca ) );
 /// </code>
 /// </remarks>
 public static void Show( DoublePCA pca )
 {
     Show( ToChart( pca ) );
 }
 /// <summary>
 /// Updates the given chart with a point (scatter) chart plotting the specified two
 /// principal components against one another.
 /// </summary>
 /// <param name="chart">A chart.</param>
 /// <param name="pca">A principal component analysis object.</param>
 /// <param name="xIndex">The index of the principal component to use for the x values.</param>
 /// <param name="yIndex">The index of the principal component to use for the y values.</param>
 /// <remarks>
 /// Titles are added only if chart does not currently contain any titles.
 /// <br/>
 /// chart.Series[0] is replaced, or added if necessary.
 /// </remarks>
 public static void Update( ref ChartControl chart, DoublePCA pca, int xIndex, int yIndex )
 {
     string title = "DoublePCA";
       string xTitle = String.Format( "PCA {0}", xIndex );
       string yTitle = String.Format( "PCA {0}", yIndex );
       ChartSeries series = BindXY( pca.Scores.Col(xIndex), pca.Scores.Col(yIndex), ChartSeriesType.Scatter, DefaultMarker );
       Update( ref chart, series, title, xTitle, yTitle );
 }
 /// <summary>
 /// Updates the given chart with a Scree chart for the given principal component analysis.
 /// </summary>
 /// <param name="chart">A chart.</param>
 /// <param name="pca">A principal component analysis object.</param>
 /// <remarks>
 /// Titles are added only if chart does not currently contain any titles.
 /// <br/>
 /// The first two data series are replaced, or added if necessary.
 /// </remarks>
 public static void Update( ref ChartControl chart, DoublePCA pca )
 {
     string title = "DoublePCA";
       string xTitle = "Principal Component";
       string yTitle = "Proportion of Variance";
       List<ChartSeries> series = new List<ChartSeries>()
       {
     BindY( pca.VarianceProportions, ChartSeriesType.Line, DefaultMarker ),
     BindY( pca.CumulativeVarianceProportions, ChartSeriesType.Line, DefaultMarker )
       };
       series[0].Text = "Variance Proportions";
       series[1].Text = "Cummulative Variance Proportions";
       Update( ref chart, series, title, xTitle, yTitle );
 }
 /// <summary>
 /// Returns a point (scatter) chart plotting the specified two principal components
 /// against one another.
 /// </summary>
 /// <param name="pca">A principal component analysis object.</param>
 /// <param name="xIndex">The index of the principal component to use for the x values.</param>
 /// <param name="yIndex">The index of the principal component to use for the y values.</param>
 /// <returns>A new chart.</returns>
 public static ChartControl ToChart( DoublePCA pca, int xIndex, int yIndex )
 {
     ChartControl chart = GetDefaultChart();
       Update( ref chart, pca, xIndex, yIndex );
       return chart;
 }
 /// <summary>
 /// Returns a Scree chart for the given principal component analysis.
 /// </summary>
 /// <param name="pca">A principal component analysis object.</param>
 /// <returns>A new chart.</returns>
 public static ChartControl ToChart( DoublePCA pca )
 {
     ChartControl chart = GetDefaultChart();
       Update( ref chart, pca );
       return chart;
 }