/** * Returns a new plot with a sequence view of specified values f(x). * Uses default sampling of x = 0, 1, 2, .... * @param f array of sampled function values f(x). * @return the plot. */ public static SimplePlot asSequence(float[] f) { SimplePlot plot = new SimplePlot(Origin.LOWER_LEFT); plot.addSequence(f); return plot; }
/** * Returns a new plot with a points view of specified values f(x). * Uses default sampling of x = 0, 1, 2, .... * @param f array of sampled function values f(x). * @return the plot. */ public static SimplePlot asPoints(float[] f) { SimplePlot plot = new SimplePlot(Origin.LOWER_LEFT); plot.addPoints(f); return plot; }
/** * Returns a new plot with a sequence view of a sampled function f(x). * @param s the sampling of the x coordinate. * @param f array of sampled function values f(x). * @return the plot. */ public static SimplePlot asSequence(Sampling s, float[] f) { SimplePlot plot = new SimplePlot(Origin.LOWER_LEFT); plot.addSequence(s,f); return plot; }
/** * Returns a new plot with a contours view of a sampled function f(x1,x2). * @param f array[n2][n1] of sampled function values f(x1,x2), where * n1 = f[0].length and n2 = f.length. * @return the plot. */ public static SimplePlot asContours(float[][] f) { SimplePlot plot = new SimplePlot(Origin.UPPER_LEFT); plot.addContours(f); return plot; }
/** * Returns a new plot with a points view of a sampled function f(x). * @param s the sampling of the x coordinate. * @param f array of sampled function values f(x). * @return the plot. */ public static SimplePlot asPoints(Sampling s, float[] f) { SimplePlot plot = new SimplePlot(Origin.LOWER_LEFT); plot.addPoints(s,f); return plot; }
/** * Returns a new plot with a points view of specified values (x,y). * @param x array of x coordinates. * @param y array of y coordinates. * @return the plot. */ public static SimplePlot asPoints(float[] x, float[] y) { SimplePlot plot = new SimplePlot(Origin.LOWER_LEFT); plot.addPoints(x,y); return plot; }
/** * Returns a new plot with a pixels view of a sampled function f(x1,x2). * Assumes zero first-sample values and unit sampling intervals. * @param f array[n2][n1] of sampled function values f(x1,x2), where * n1 = f[0].length and n2 = f.length. * @return the plot. */ public static SimplePlot asPixels(float[][] f) { SimplePlot plot = new SimplePlot(Origin.UPPER_LEFT); PixelsView pv = plot.addPixels(f); pv.setInterpolation(PixelsView.Interpolation.NEAREST); return plot; }
/** * Returns a new plot with a pixels view of a sampled function f(x1,x2). * @param s1 the sampling of the x1 coordinate. * @param s2 the sampling of the x2 coordinate. * @param f array[n2][n1] of sampled function values f(x1,x2), where * n1 = f[0].length and n2 = f.length. * @return the plot. */ public static SimplePlot asPixels(Sampling s1, Sampling s2, float[][] f) { SimplePlot plot = new SimplePlot(Origin.UPPER_LEFT); PixelsView pv = plot.addPixels(s1,s2,f); pv.setInterpolation(PixelsView.Interpolation.NEAREST); return plot; }
private static void plot(float[][] f) { trace("plot f min="+ min(f)+" max="+max(f)); edu.mines.jtk.mosaic.SimplePlot sp = new edu.mines.jtk.mosaic.SimplePlot( edu.mines.jtk.mosaic.SimplePlot.Origin.UPPER_LEFT); sp.setSize(920,900); edu.mines.jtk.mosaic.PixelsView pv = sp.addPixels(f); pv.setColorModel(edu.mines.jtk.awt.ColorMap.JET); pv.setInterpolation(edu.mines.jtk.mosaic.PixelsView.Interpolation.NEAREST); } }
private static void plot(float[][] f) { trace("plot f min="+ min(f)+" max="+max(f)); edu.mines.jtk.mosaic.SimplePlot sp = new edu.mines.jtk.mosaic.SimplePlot( edu.mines.jtk.mosaic.SimplePlot.Origin.UPPER_LEFT); sp.setSize(920,900); edu.mines.jtk.mosaic.PixelsView pv = sp.addPixels(f); pv.setColorModel(edu.mines.jtk.awt.ColorMap.JET); pv.setInterpolation(edu.mines.jtk.mosaic.PixelsView.Interpolation.NEAREST); } }
private static void plot3() { SimplePlot plot = new SimplePlot(); plot.addGrid("H-.V-."); float[] f = sin(rampfloat(0.0f,0.1f,63)); plot.addPoints(f).setStyle("r-o"); float[] g = cos(rampfloat(0.0f,0.1f,63)); plot.addPoints(g).setStyle("b-x"); plot.setTitle("A simple plot of two arrays"); plot.setVLabel("array value"); plot.setHLabel("array index"); } }
public void run() { System.out.println("min="+ min(g)+" max="+ max(g)); SimplePlot sp = new SimplePlot(); sp.setTitle(method); sp.setSize(847,740); sp.addColorBar(); sp.getPlotPanel().setColorBarWidthMinimum(100); PixelsView pv = sp.addPixels(SX,SX,g); pv.setColorModel(ColorMap.JET); pv.setInterpolation(PixelsView.Interpolation.LINEAR); if (cmin<cmax) pv.setClips(cmin,cmax); PointsView px = sp.addPoints(x1,x2); px.setLineStyle(PointsView.Line.NONE); px.setMarkStyle(PointsView.Mark.FILLED_CIRCLE); px.setMarkSize(6); } });
public void run() { System.out.println("min="+ min(g)+" max="+ max(g)); SimplePlot sp = new SimplePlot(); sp.setTitle(method); sp.setSize(847,740); sp.addColorBar(); sp.getPlotPanel().setColorBarWidthMinimum(100); PixelsView pv = sp.addPixels(SX,SX,g); pv.setColorModel(ColorMap.JET); pv.setInterpolation(PixelsView.Interpolation.LINEAR); if (cmin<cmax) pv.setClips(cmin,cmax); PointsView px = sp.addPoints(x1,x2); px.setLineStyle(PointsView.Line.NONE); px.setMarkStyle(PointsView.Mark.FILLED_CIRCLE); px.setMarkSize(6); } });