/** * Create a plot canvas with the contour plot of given data. * @param z a matrix. */ public static PlotCanvas plot(double[] x, double[] y, double[][] z) { double[] lowerBound = {Math.min(x), Math.min(y)}; double[] upperBound = {Math.max(x), Math.max(y)}; PlotCanvas canvas = new PlotCanvas(lowerBound, upperBound, false); canvas.add(new Contour(x, y, z)); return canvas; }
/** * Create a plot canvas with the contour plot of given data. * @param z a matrix. */ public static PlotCanvas plot(double[] x, double[] y, double[][] z, double[] levels, Color[] palette) { double[] lowerBound = {Math.min(x), Math.min(y)}; double[] upperBound = {Math.max(x), Math.max(y)}; PlotCanvas canvas = new PlotCanvas(lowerBound, upperBound, false); canvas.add(new Contour(x, y, z, levels, palette)); return canvas; } }
/** * Create a plot canvas with the contour plot of given data. * @param z a matrix. */ public static PlotCanvas plot(double[][] z) { double[] lowerBound = {0, 0}; double[] upperBound = {z[0].length, z.length}; PlotCanvas canvas = new PlotCanvas(lowerBound, upperBound, false); canvas.add(new Contour(z)); canvas.getAxis(0).setLabelVisible(false); canvas.getAxis(1).setLabelVisible(false); return canvas; }
/** * Create a plot canvas with the contour plot of given data. * @param z a matrix. */ public static PlotCanvas plot(double[][] z, double[] levels, Color[] palette) { double[] lowerBound = {0, 0}; double[] upperBound = {z[0].length, z.length}; PlotCanvas canvas = new PlotCanvas(lowerBound, upperBound, false); canvas.add(new Contour(z, levels, palette)); canvas.getAxis(0).setLabelVisible(false); canvas.getAxis(1).setLabelVisible(false); return canvas; }