- Timestamp:
- 12/16/16 14:47:38 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/ScatterPlotContent.cs
r14474 r14495 42 42 ScatterPlot scatterPlot = new ScatterPlot(); 43 43 44 IList<double> xValues = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableNameX)) ;45 IList<double> yValues = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableNameY)) ;44 IList<double> xValues = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableNameX)).Where(x => !double.IsNaN(x) && !double.IsInfinity(x)).ToList(); 45 IList<double> yValues = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableNameY)).Where(x => !double.IsNaN(x) && !double.IsInfinity(x)).ToList(); 46 46 47 double axisMin, axisMax, axisInterval; 48 try { 49 ChartUtil.CalculateOptimalAxisInterval(xValues.Min(), xValues.Max(), out axisMin, out axisMax, out axisInterval); 50 scatterPlot.VisualProperties.XAxisMinimumAuto = false; 51 scatterPlot.VisualProperties.XAxisMaximumAuto = false; 52 scatterPlot.VisualProperties.XAxisMinimumFixedValue = axisMin; 53 scatterPlot.VisualProperties.XAxisMaximumFixedValue = axisMax; 54 } catch (ArgumentOutOfRangeException) { } // missing values lead to NaNs 55 try { 56 ChartUtil.CalculateOptimalAxisInterval(yValues.Min(), yValues.Max(), out axisMin, out axisMax, out axisInterval); 57 scatterPlot.VisualProperties.YAxisMinimumAuto = false; 58 scatterPlot.VisualProperties.YAxisMaximumAuto = false; 59 scatterPlot.VisualProperties.YAxisMinimumFixedValue = axisMin; 60 scatterPlot.VisualProperties.YAxisMaximumFixedValue = axisMax; 61 } catch (ArgumentOutOfRangeException) { } // missing values lead to NaNs 47 if (xValues.Any()) { 48 try { 49 double axisMin, axisMax, axisInterval; 50 ChartUtil.CalculateOptimalAxisInterval(xValues.Min(), xValues.Max(), out axisMin, out axisMax, out axisInterval); 51 scatterPlot.VisualProperties.XAxisMinimumAuto = false; 52 scatterPlot.VisualProperties.XAxisMaximumAuto = false; 53 scatterPlot.VisualProperties.XAxisMinimumFixedValue = axisMin; 54 scatterPlot.VisualProperties.XAxisMaximumFixedValue = axisMax; 55 } catch (ArgumentOutOfRangeException) { } // error during CalculateOptimalAxisInterval 56 } 57 if (yValues.Any()) { 58 try { 59 double axisMin, axisMax, axisInterval; 60 ChartUtil.CalculateOptimalAxisInterval(yValues.Min(), yValues.Max(), out axisMin, out axisMax, out axisInterval); 61 scatterPlot.VisualProperties.YAxisMinimumAuto = false; 62 scatterPlot.VisualProperties.YAxisMaximumAuto = false; 63 scatterPlot.VisualProperties.YAxisMinimumFixedValue = axisMin; 64 scatterPlot.VisualProperties.YAxisMaximumFixedValue = axisMax; 65 } catch (ArgumentOutOfRangeException) { } // error during CalculateOptimalAxisInterval 66 } 62 67 63 68 if (variableNameGroup == null || variableNameGroup == "-") { … … 69 74 } 70 75 71 ScatterPlotDataRow scdr = new ScatterPlotDataRow(variableNameX + " - " + variableNameY, "", points) { 72 VisualProperties = { PointSize = 6 } 73 }; 76 ScatterPlotDataRow scdr = new ScatterPlotDataRow(variableNameX + " - " + variableNameY, "", points); 74 77 scdr.VisualProperties.IsVisibleInLegend = false; 75 78 scatterPlot.Rows.Add(scdr);
Note: See TracChangeset
for help on using the changeset viewer.