From 4c2651087b9f99c49b67579207fa5f232e5ee162 Mon Sep 17 00:00:00 2001 From: Stefan Schroeder <4sschroeder@gmail.com> Date: Thu, 5 Dec 2013 18:14:45 +0100 Subject: [PATCH] issue #60 - scale plotter accoring to solution --- .../main/java/jsprit/analysis/toolbox/Plotter.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/jsprit-analysis/src/main/java/jsprit/analysis/toolbox/Plotter.java b/jsprit-analysis/src/main/java/jsprit/analysis/toolbox/Plotter.java index 8849f6ae..5416755f 100644 --- a/jsprit-analysis/src/main/java/jsprit/analysis/toolbox/Plotter.java +++ b/jsprit-analysis/src/main/java/jsprit/analysis/toolbox/Plotter.java @@ -268,13 +268,13 @@ public class Plotter { return plot; } - private Range getRange(final XYSeriesCollection problem) { - if(this.boundingBox==null) return problem.getRangeBounds(false); + private Range getRange(final XYSeriesCollection seriesCol) { + if(this.boundingBox==null) return seriesCol.getRangeBounds(false); else return new Range(boundingBox.minY, boundingBox.maxY); } - private Range getDomainRange(final XYSeriesCollection problem) { - if(this.boundingBox == null) return problem.getDomainBounds(true); + private Range getDomainRange(final XYSeriesCollection seriesCol) { + if(this.boundingBox == null) return seriesCol.getDomainBounds(true); else return new Range(boundingBox.minX, boundingBox.maxX); } @@ -297,10 +297,10 @@ public class Plotter { problemRenderer.setBaseItemLabelPaint(Color.BLACK); NumberAxis xAxis = new NumberAxis(); - xAxis.setRangeWithMargins(getDomainRange(problem)); + xAxis.setRangeWithMargins(getDomainRange(solutionColl)); NumberAxis yAxis = new NumberAxis(); - yAxis.setRangeWithMargins(getRange(problem)); + yAxis.setRangeWithMargins(getRange(solutionColl)); plot.setDataset(0, problem); plot.setRenderer(0, problemRenderer);