Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14405 for trunk/sources


Ignore:
Timestamp:
11/22/16 17:31:16 (7 years ago)
Author:
gkronber
Message:

#2702: switched axes for predicted and actual values in scatter plot

File:
1 edited

Legend:

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

    r14255 r14405  
    7676      //configure axis
    7777      this.chart.CustomizeAllChartAreas();
    78       this.chart.ChartAreas[0].AxisX.Title = "Estimated Values";
     78      this.chart.ChartAreas[0].AxisY.Title = "Estimated Values";
     79      this.chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
     80      this.chart.ChartAreas[0].AxisY.ScaleView.Zoomable = true;
     81      this.chart.ChartAreas[0].CursorX.Interval = 1;
     82      this.chart.ChartAreas[0].CursorY.Interval = 1;
     83
     84      this.chart.ChartAreas[0].AxisX.Title = "Target Values";
    7985      this.chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
    8086      this.chart.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
    81       this.chart.ChartAreas[0].CursorX.Interval = 1;
    82       this.chart.ChartAreas[0].CursorY.Interval = 1;
    83 
    84       this.chart.ChartAreas[0].AxisY.Title = "Target Values";
    85       this.chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
    86       this.chart.ChartAreas[0].AxisY.ScaleView.Zoomable = true;
    87       this.chart.ChartAreas[0].AxisY.IsStartedFromZero = true;
     87      this.chart.ChartAreas[0].AxisX.IsStartedFromZero = true;
    8888    }
    8989
     
    158158        var dataset = Content.ProblemData.Dataset;
    159159        if (this.chart.Series[ALL_SERIES].Points.Count > 0)
    160           this.chart.Series[ALL_SERIES].Points.DataBindXY(Content.EstimatedValues.ToArray(), "",
    161             dataset.GetDoubleValues(targetVariableName).ToArray(), "");
     160          this.chart.Series[ALL_SERIES].Points.DataBindXY(dataset.GetDoubleValues(targetVariableName).ToArray(), "",
     161            Content.EstimatedValues.ToArray(), "");
    162162        if (this.chart.Series[TRAINING_SERIES].Points.Count > 0)
    163           this.chart.Series[TRAINING_SERIES].Points.DataBindXY(Content.EstimatedTrainingValues.ToArray(), "",
    164             dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TrainingIndices).ToArray(), "");
     163          this.chart.Series[TRAINING_SERIES].Points.DataBindXY(dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TrainingIndices).ToArray(), "",
     164            Content.EstimatedTrainingValues.ToArray(), "");
    165165        if (this.chart.Series[TEST_SERIES].Points.Count > 0)
    166           this.chart.Series[TEST_SERIES].Points.DataBindXY(Content.EstimatedTestValues.ToArray(), "",
    167            dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TestIndices).ToArray(), "");
    168 
     166          this.chart.Series[TEST_SERIES].Points.DataBindXY(dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TestIndices).ToArray(), "",
     167            Content.EstimatedTestValues.ToArray(), "");
    169168        double max = Content.EstimatedTrainingValues.Concat(Content.EstimatedTestValues.Concat(Content.EstimatedValues.Concat(dataset.GetDoubleValues(targetVariableName)))).Max();
    170169        double min = Content.EstimatedTrainingValues.Concat(Content.EstimatedTestValues.Concat(Content.EstimatedValues.Concat(dataset.GetDoubleValues(targetVariableName)))).Min();
     
    172171        double axisMin, axisMax, axisInterval;
    173172        ChartUtil.CalculateOptimalAxisInterval(min, max, out axisMin, out axisMax, out axisInterval);
    174         this.chart.ChartAreas[0].AxisX.Title = "Estimated " + targetVariableName;
     173        this.chart.ChartAreas[0].AxisY.Title = "Estimated " + targetVariableName;
     174        this.chart.ChartAreas[0].AxisY.Maximum = axisMax;
     175        this.chart.ChartAreas[0].AxisY.Minimum = axisMin;
     176        this.chart.ChartAreas[0].AxisY.Interval = axisInterval;
     177        this.chart.ChartAreas[0].AxisX.Title = targetVariableName;
    175178        this.chart.ChartAreas[0].AxisX.Maximum = axisMax;
    176179        this.chart.ChartAreas[0].AxisX.Minimum = axisMin;
    177180        this.chart.ChartAreas[0].AxisX.Interval = axisInterval;
    178         this.chart.ChartAreas[0].AxisY.Title = targetVariableName;
    179         this.chart.ChartAreas[0].AxisY.Maximum = axisMax;
    180         this.chart.ChartAreas[0].AxisY.Minimum = axisMin;
    181         this.chart.ChartAreas[0].AxisY.Interval = axisInterval;
    182181
    183182        UpdateCursorInterval();
     
    216215        }
    217216        if (predictedValues.Length == targetValues.Length)
    218           series.Points.DataBindXY(predictedValues, "", targetValues, "");
     217          series.Points.DataBindXY(targetValues, "", predictedValues, "");
    219218        this.chart.Legends[series.Legend].ForeColor = Color.Black;
    220219        UpdateCursorInterval();
Note: See TracChangeset for help on using the changeset viewer.