/** * 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; }
/** * Adds 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 points view. */ public PointsView addPoints(Sampling s, double[] f) { return addPoints(s,convertToFloat(f)); }
/** * 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; }
/** * Adds 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 points view. */ public PointsView addPoints(double[] f) { return addPoints(convertToFloat(f)); }
/** * Adds a points view of specified values (x,y). * @param x array of x coordinates. * @param y array of y coordinates. * @return the points view. */ public PointsView addPoints(double[] x, double[] y) { return addPoints(convertToFloat(x),convertToFloat(y)); }
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); } });