/** * Constructor. * @param z the data matrix to create contour plot. * @param numLevels the number of contour levels. * @param logScale true to interpolate contour levels in logarithmic scale. */ public Contour(double[][] z, int numLevels, boolean logScale) { this.z = z; this.numLevels = numLevels; this.logScale = logScale; init(); }
switch (nacode) { case 15: if (isIntersect(zll, zhl, zc)) { double f = getIntersectRatio(zll, zhl, zc); xx[k] = xl + f * (xh - xl); yy[k] = yl; if (isIntersect(zll, zlh, zc)) { double f = getIntersectRatio(zll, zlh, zc); yy[k] = yl + f * (yh - yl); xx[k] = xl; if (isIntersect(zhl, zhh, zc)) { double f = getIntersectRatio(zhl, zhh, zc); yy[k] = yl + f * (yh - yl); xx[k] = xh; if (isIntersect(zlh, zhh, zc)) { double f = getIntersectRatio(zlh, zhh, zc); xx[k] = xl + f * (xh - xl); yy[k] = yh; if (isIntersect(zhl, zhh, zc)) { double f = getIntersectRatio(zhl, zhh, zc); yy[k] = yl + f * (yh - yl); xx[k] = xh; k++; if (isIntersect(zlh, zhh, zc)) {
case 1: case 3: if (YMATCH(yend, seglist.y0)) { if (!tail) { seglist.swap(); if (YMATCH(yend, seglist.y1)) { if (tail) { seglist.swap(); if (YMATCH(yend, seglist.y1)) { if (tail) { seglist.swap(); if (XMATCH(xend, seglist.x0)) { if (!tail) { seglist.swap(); if (XMATCH(xend, seglist.x1)) { if (tail) { seglist.swap(); seglist.next = segupdate(xend, yend, dir, tail, seg2); seg[1] = seg2[1];
/** * 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[][] 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; }
/** * Constructor. * @param z the data matrix to create contour plot. */ public Contour(double[][] z) { this.z = z; init(); }
/** * 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; } }
/** * Constructor. * @param z the data matrix to create contour plot. * @param numLevels the number of contour levels. */ public Contour(double[][] z, int numLevels) { this.z = z; this.numLevels = numLevels; init(); }
/** * 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; }
/** * Constructor. * @param z the data matrix to create contour plot. * @param levels the level values of contours. */ public Contour(double[][] z, double[] levels) { this.z = z; this.levels = levels; init(); }
/** * Constructor. * @param z the data matrix to create contour plot. * @param levels the level values of contours. * @param colors the color for each contour level. */ public Contour(double[][] z, double[] levels, Color[] colors) { this.z = z; this.levels = levels; this.colors = colors; showLevelValue = false; init(); }
/** * Constructor. * @param x the x coordinates of the data grid of z. Must be in ascending order. * @param y the y coordinates of the data grid of z. Must be in ascending order. * @param z the data matrix to create contour plot. * @param numLevels the number of contour levels. */ public Contour(double[] x, double[] y, double[][] z, int numLevels) { if (x.length != z[0].length) { throw new IllegalArgumentException(DIMENSIONS_XZ_DONT_MATCH); } if (y.length != z.length) { throw new IllegalArgumentException(DIMENSIONS_YZ_DONT_MATCH); } this.x = x; this.y = y; this.z = z; this.numLevels = numLevels; init(); }
/** * Constructor. * @param x the x coordinates of the data grid of z. Must be in ascending order. * @param y the y coordinates of the data grid of z. Must be in ascending order. * @param z the data matrix to create contour plot. */ public Contour(double[] x, double[] y, double[][] z) { if (x.length != z[0].length) { throw new IllegalArgumentException(DIMENSIONS_XZ_DONT_MATCH); } if (y.length != z.length) { throw new IllegalArgumentException(DIMENSIONS_YZ_DONT_MATCH); } this.x = x; this.y = y; this.z = z; init(); }
/** * Constructor. * @param x the x coordinates of the data grid of z. Must be in ascending order. * @param y the y coordinates of the data grid of z. Must be in ascending order. * @param z the data matrix to create contour plot. * @param levels the level values of contours. Must be strictly increasing and finite. */ public Contour(double[] x, double[] y, double[][] z, double[] levels) { if (x.length != z[0].length) { throw new IllegalArgumentException(DIMENSIONS_XZ_DONT_MATCH); } if (y.length != z.length) { throw new IllegalArgumentException(DIMENSIONS_YZ_DONT_MATCH); } this.x = x; this.y = y; this.z = z; this.levels = levels; init(); }
/** * Constructor. * @param x the x coordinates of the data grid of z. Must be in ascending order. * @param y the y coordinates of the data grid of z. Must be in ascending order. * @param z the data matrix to create contour plot. * @param numLevels the number of contour levels. * @param logScale true to interpolate contour levels in logarithmical scale. */ public Contour(double[] x, double[] y, double[][] z, int numLevels, boolean logScale) { if (x.length != z[0].length) { throw new IllegalArgumentException(DIMENSIONS_XZ_DONT_MATCH); } if (y.length != z.length) { throw new IllegalArgumentException(DIMENSIONS_YZ_DONT_MATCH); } this.x = x; this.y = y; this.z = z; this.numLevels = numLevels; this.logScale = logScale; init(); }
/** * Constructor. * @param x the x coordinates of the data grid of z. Must be in ascending order. * @param y the y coordinates of the data grid of z. Must be in ascending order. * @param z the data matrix to create contour plot. * @param levels the level values of contours. Must be strictly increasing and finite. * @param colors the color for each contour level. */ public Contour(double[] x, double[] y, double[][] z, double[] levels, Color[] colors) { if (x.length != z[0].length) { throw new IllegalArgumentException(DIMENSIONS_XZ_DONT_MATCH); } if (y.length != z.length) { throw new IllegalArgumentException(DIMENSIONS_YZ_DONT_MATCH); } if (levels.length != colors.length) { throw new IllegalArgumentException("The number of levels and colors don't match."); } this.x = x; this.y = y; this.z = z; this.levels = levels; this.colors = colors; showLevelValue = false; init(); }