Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12365 for trunk


Ignore:
Timestamp:
04/29/15 16:39:46 (10 years ago)
Author:
mkommend
Message:

#2345: Fixed x-axis maximum in error characteristics curve.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs

    r12012 r12365  
    4848      chart.ChartAreas[0].AxisX.Title = "Absolute Error";
    4949      chart.ChartAreas[0].AxisX.Minimum = 0.0;
    50       chart.ChartAreas[0].AxisX.Maximum = 1.0;
     50      chart.ChartAreas[0].AxisX.Maximum = 0.0;
    5151      chart.ChartAreas[0].AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;
    5252      chart.ChartAreas[0].CursorX.Interval = 0.01;
     
    118118      solutionSeries.ChartType = SeriesChartType.FastLine;
    119119      var residuals = GetResiduals(GetOriginalValues(), GetEstimatedValues(solution));
    120      
    121       chart.ChartAreas[0].AxisX.Maximum = Math.Ceiling(residuals.Max());
     120
     121
     122      var maxValue = residuals.Max();
     123      if (maxValue >= chart.ChartAreas[0].AxisX.Maximum) {
     124        double scale = Math.Pow(10, Math.Floor(Math.Log10(maxValue)));
     125        var maximum = scale * (1 + (int)(maxValue / scale));
     126        chart.ChartAreas[0].AxisX.Maximum = maximum;
     127      }
    122128      chart.ChartAreas[0].CursorX.Interval = residuals.Min() / 100;
    123129
Note: See TracChangeset for help on using the changeset viewer.