def plot = new Plot(title: "Default scale") def ys = [0, 3, 4, 6, 8, 10] def ys2 = [1, 3, 4, 7, 9, 11] plot << new YAxis(label:"Spread") plot << new Line(y: ys) plot << new Line(y: ys2, yAxis: "Spread") plot def plot = new Plot(title: "The same scale") def ys = [0, 3, 4, 6, 8, 10] def ys2 = [1, 3, 4, 7, 9, 11] plot << new YAxis(label:"Spread") plot << new Line(y: ys) plot << new Line(y: ys2, yAxis: "Spread") plot.getYAxes()[0].setBound(1, 11); plot.getYAxes()[1].setBound(1, 11); plot def plot = new Plot(title: "2nd YAxis is zoomed") def ys = [0, 3, 4, 6, 8, 10] def ys2 = [1, 3, 4, 7, 9, 11] plot << new YAxis(label:"Spread") plot << new Line(y: ys) plot << new Line(y: ys2, yAxis: "Spread") plot.getYAxes()[0].setBound(0, 10); plot.getYAxes()[1].setBound(0, 7); plot def plot = new CategoryPlot(title: "Default scale") def cs = [new Color(255, 0, 0, 128)] * 5 // transparent color def cs1 = [new Color(0, 0, 0, 128)] * 5 // transparent color plot << new YAxis(label:"nd") plot << new CategoryBars(value: [[4, 4, 4, 8], [5, 5, 5, 9]], color: cs) plot << new CategoryBars(value: [[2, 4, 6, 8], [3, 5, 7, 9]], color: cs1, yAxis: "nd") plot def plot = new CategoryPlot(title: "The same scale") def cs = [new Color(255, 0, 0, 128)] * 5 // transparent color def cs1 = [new Color(0, 0, 0, 128)] * 5 // transparent color plot << new YAxis(label:"nd") plot << new CategoryBars(value: [[4, 4, 4, 8], [5, 5, 5, 9]], color: cs) plot << new CategoryBars(value: [[2, 4, 6, 8], [3, 5, 7, 9]], color: cs1, yAxis: "nd") plot.getYAxes()[0].setBound(0, 11); plot.getYAxes()[1].setBound(0, 11); plot def plot = new CategoryPlot(title: "2nd YAxis is zoomed") def cs = [new Color(255, 0, 0, 128)] * 5 // transparent color def cs1 = [new Color(0, 0, 0, 128)] * 5 // transparent color plot << new YAxis(label:"nd") plot << new CategoryBars(value: [[4, 4, 4, 8], [5, 5, 5, 9]], color: cs) plot << new CategoryBars(value: [[2, 4, 6, 8], [3, 5, 7, 9]], color: cs1, yAxis: "nd") plot.getYAxes()[0].setBound(0, 9); plot.getYAxes()[1].setBound(0, 7); plot def plot = new Plot(title: "Default scale"); plot << new YAxis(label:"nd") def ss = [StrokeType.DASH, StrokeType.DASH, StrokeType.DASH, StrokeType.DASH, StrokeType.DASH] plot << new Stems(y: [4, 4, 4, 8, 9], width: 2) plot << new Stems(y: [2, 4, 6, 5, 9], width: 6, style: ss, yAxis: "nd") plot def plot = new Plot(title: "The same scale"); plot << new YAxis(label:"nd") def ss = [StrokeType.DASH, StrokeType.DASH, StrokeType.DASH, StrokeType.DASH, StrokeType.DASH] plot << new Stems(y: [4, 4, 4, 8, 9], width: 2) plot << new Stems(y: [2, 4, 6, 5, 9], width: 6, style: ss, yAxis: "nd") plot.getYAxes()[0].setBound(0, 11); plot.getYAxes()[1].setBound(0, 11); plot def plot = new Plot(title: "2nd YAxis is zoomed"); plot << new YAxis(label:"nd") def ss = [StrokeType.DASH, StrokeType.DASH, StrokeType.DASH, StrokeType.DASH, StrokeType.DASH] plot << new Stems(y: [4, 4, 4, 8, 9], width: 2) plot << new Stems(y: [2, 4, 6, 5, 9], width: 6, style: ss, yAxis: "nd") plot.getYAxes()[0].setBound(0, 9); plot.getYAxes()[1].setBound(0, 7); plot def plot = new Plot(title: "Default scale") def cs = [new Color(255, 0, 0, 128)] * 5 // transparent bars def cs1 = [new Color(0, 0, 0, 128)] * 5 // transparent bars plot << new YAxis(label:"nd") plot << new Bars(y: [4, 4, 4, 8, 9], color: cs, width: 0.3) plot << new Bars(y: [2, 4, 6, 5, 9], color: cs1, width: 0.3, yAxis: "nd") plot def plot = new Plot(title: "The same scale") def cs = [new Color(255, 0, 0, 128)] * 5 // transparent bars def cs1 = [new Color(0, 0, 0, 128)] * 5 // transparent bars plot << new YAxis(label:"nd") plot << new Bars(y: [4, 4, 4, 8, 9], color: cs, width: 0.3) plot << new Bars(y: [2, 4, 6, 5, 9], color: cs1, width: 0.3, yAxis: "nd") plot.getYAxes()[0].setBound(0, 11); plot.getYAxes()[1].setBound(0, 11); plot def plot = new Plot(title: "2nd YAxis is zoomed") def cs = [new Color(255, 0, 0, 128)] * 5 // transparent bars def cs1 = [new Color(0, 0, 0, 128)] * 5 // transparent bars plot << new YAxis(label:"nd") plot << new Bars(y: [4, 4, 4, 8, 9], color: cs, width: 0.3) plot << new Bars(y: [2, 4, 6, 5, 9], color: cs1, width: 0.3, yAxis: "nd") plot.getYAxes()[0].setBound(0, 9); plot.getYAxes()[1].setBound(0, 7); plot def plot = new Plot(title: "Default scale") plot << new YAxis(label:"nd") plot << new Points(y: [4, 4, 4, 8, 9], size: 12.0, shape: ShapeType.CIRCLE) plot << new Points(y: [2, 4, 6, 5, 9], size: 5.0, shape: ShapeType.CIRCLE, yAxis: "nd") plot def plot = new Plot(title: "The same scale") plot << new YAxis(label:"nd") plot << new Points(y: [4, 4, 4, 8, 9], size: 12.0, shape: ShapeType.CIRCLE) plot << new Points(y: [2, 4, 6, 5, 9], size: 5.0, shape: ShapeType.CIRCLE, yAxis: "nd") plot.getYAxes()[0].setBound(0, 11); plot.getYAxes()[1].setBound(0, 11); plot def plot = new Plot(title: "2nd YAxis is zoomed") plot << new YAxis(label:"nd") plot << new Points(y: [4, 4, 4, 8, 9], size: 12.0, shape: ShapeType.CIRCLE) plot << new Points(y: [2, 4, 6, 5, 9], size: 5.0, shape: ShapeType.CIRCLE, yAxis: "nd") plot.getYAxes()[0].setBound(0, 9); plot.getYAxes()[1].setBound(0, 7); plot def plot = new Plot(title: "Default scale") plot << new YAxis(label:"nd") plot << new Area(y: [4, 4, 4, 8, 9]) plot << new Area(y: [2, 4, 6, 5, 9], yAxis: "nd") plot def plot = new Plot(title: "The same scale") plot << new YAxis(label:"nd") plot << new Area(y: [4, 4, 4, 8, 9]) plot << new Area(y: [2, 4, 6, 5, 9], yAxis: "nd") plot.getYAxes()[0].setBound(0, 11); plot.getYAxes()[1].setBound(0, 11); plot def plot = new Plot(title: "2nd YAxis is zoomed") plot << new YAxis(label:"nd") plot << new Area(y: [4, 4, 4, 8, 9]) plot << new Area(y: [2, 4, 6, 5, 9], yAxis: "nd") plot.getYAxes()[0].setBound(0, 9); plot.getYAxes()[1].setBound(0, 7); plot def cs1 = [new Color(255, 0, 0, 128)] * 5 // transparent bars def cs2 = [new Color(0, 0, 0, 128)] * 5 // transparent bars def ss = [StrokeType.DASH, StrokeType.DASH, StrokeType.DASH, StrokeType.DASH, StrokeType.DASH] def y1 = [4, 4, 4, 8, 9] def y2 = [2, 4, 6, 5, 9] def plot = new Plot(title: "Default scale") plot << new YAxis(label: "nd") plot << new Line(y: y1) plot << new Points(y: y1, size: 12.0, shape: ShapeType.CIRCLE) plot << new Bars(y: y1, color: cs1, width: 0.3) plot << new Stems(y: [4, 4, 4, 8, 9], width: 2) plot << new Line(y: y2, yAxis: "nd") plot << new Points(y: y2, size: 5.0, shape: ShapeType.CIRCLE, yAxis: "nd") plot << new Bars(y: y2, color: cs2, width: 0.3, yAxis: "nd") plot << new Stems(y: [2, 4, 6, 5, 9], width: 6, style: ss, yAxis: "nd") plot def cs1 = [new Color(255, 0, 0, 128)] * 5 // transparent bars def cs2 = [new Color(0, 0, 0, 128)] * 5 // transparent bars def ss = [StrokeType.DASH, StrokeType.DASH, StrokeType.DASH, StrokeType.DASH, StrokeType.DASH] def y1 = [4, 4, 4, 8, 9] def y2 = [2, 4, 6, 5, 9] def plot = new Plot(title: "The same scale") plot << new YAxis(label: "nd") plot << new Line(y: y1) plot << new Points(y: y1, size: 12.0, shape: ShapeType.CIRCLE) plot << new Bars(y: y1, color: cs1, width: 0.3) plot << new Stems(y: [4, 4, 4, 8, 9], width: 2) plot << new Line(y: y2, yAxis: "nd") plot << new Points(y: y2, size: 5.0, shape: ShapeType.CIRCLE, yAxis: "nd") plot << new Bars(y: y2, color: cs2, width: 0.3, yAxis: "nd") plot << new Stems(y: [2, 4, 6, 5, 9], width: 6, style: ss, yAxis: "nd") plot.getYAxes()[0].setBound(0, 11); plot.getYAxes()[1].setBound(0, 11); plot def cs1 = [new Color(255, 0, 0, 128)] * 5 // transparent bars def cs2 = [new Color(0, 0, 0, 128)] * 5 // transparent bars def ss = [StrokeType.DASH, StrokeType.DASH, StrokeType.DASH, StrokeType.DASH, StrokeType.DASH] def y1 = [4, 4, 4, 8, 9] def y2 = [2, 4, 6, 5, 9] def plot = new Plot(title: "2nd YAxis is zoomed") plot << new YAxis(label: "nd") plot << new Line(y: y1) plot << new Points(y: y1, size: 12.0, shape: ShapeType.CIRCLE) plot << new Bars(y: y1, color: cs1, width: 0.3) plot << new Stems(y: [4, 4, 4, 8, 9], width: 2) plot << new Line(y: y2, yAxis: "nd") plot << new Points(y: y2, size: 5.0, shape: ShapeType.CIRCLE, yAxis: "nd") plot << new Bars(y: y2, color: cs2, width: 0.3, yAxis: "nd") plot << new Stems(y: [2, 4, 6, 5, 9], width: 6, style: ss, yAxis: "nd") plot.getYAxes()[0].setBound(0, 9); plot.getYAxes()[1].setBound(0, 7); plot