/** Adds a set of points to the plot or adds a curve if shape is set to LINE. * Note that there are more options available by using the methods of the Plot class instead. * @param x the x-coodinates * @param y the y-coodinates * @param shape Plot.CIRCLE, X, BOX, TRIANGLE, CROSS, LINE etc. * @deprecated use the corresponding method of the Plot class */ public void addPoints(float[] x, float[] y, int shape) { plot.addPoints(x, y, shape); }
/** Adds a set of points to the plot or adds a curve if shape is set to LINE. * @param x the x coordinates * @param y the y coordinates * @param shape CIRCLE, X, BOX, TRIANGLE, CROSS, DIAMOND, DOT, LINE, CONNECTED_CIRCLES */ public void addPoints(float[] x, float[] y, int shape) { addPoints(x, y, null, shape, null); }
/** Adds a set of points to the plot or adds a curve if shape is set to LINE. * Note that there are more options available by using the methods of the Plot class instead. * @param x the x-coodinates * @param y the y-coodinates * @param shape Plot.CIRCLE, X, BOX, TRIANGLE, CROSS, LINE etc. * @deprecated use the corresponding method of the Plot class */ public void addPoints(float[] x, float[] y, int shape) { plot.addPoints(x, y, shape); }
/** Adds a set of points to the plot or adds a curve if shape is set to LINE. * @param x the x coordinates * @param y the y coordinates * @param shape CIRCLE, X, BOX, TRIANGLE, CROSS, DIAMOND, DOT, LINE, CONNECTED_CIRCLES */ public void addPoints(float[] x, float[] y, int shape) { addPoints(x, y, null, shape, null); }
public void addPoints(String dummy, float[] x, float[] y, int shape) { addPoints(x, y, shape); }
public void addPoints(String dummy, float[] x, float[] y, int shape) { addPoints(x, y, shape); }
/** Obsolete, replaced by "new Plot(title,xLabel,yLabel,flags); add(shape,x,y);". * @deprecated */ public Plot(String title, String xLabel, String yLabel, float[] xValues, float[] yValues, int flags) { this.title = title; pp.axisFlags = flags; setXYLabels(xLabel, yLabel); if (yValues != null && yValues.length>0) { addPoints(xValues, yValues, /*yErrorBars=*/null, LINE, /*label=*/null); allPlotObjects.get(0).flags = PlotObject.CONSTRUCTOR_DATA; } }
/** Obsolete, replaced by "new Plot(title,xLabel,yLabel,flags); add(shape,x,y);". * @deprecated */ public Plot(String title, String xLabel, String yLabel, float[] xValues, float[] yValues, int flags) { this.title = title; pp.axisFlags = flags; setXYLabels(xLabel, yLabel); if (yValues != null && yValues.length>0) { addPoints(xValues, yValues, /*yErrorBars=*/null, LINE, /*label=*/null); allPlotObjects.get(0).flags = PlotObject.CONSTRUCTOR_DATA; } }
/** Adds a set of points to the plot using double ArrayLists. * Must be called before the plot is displayed. */ public void addPoints(ArrayList x, ArrayList y, int shape) { addPoints(getDoubleFromArrayList(x), getDoubleFromArrayList(y), shape); }
/** Adds a set of points to the plot using double arrays. */ public void addPoints(double[] x, double[] y, int shape) { addPoints(Tools.toFloat(x), Tools.toFloat(y), shape); }
/** Adds a set of points to the plot using double ArrayLists. * Must be called before the plot is displayed. */ public void addPoints(ArrayList x, ArrayList y, int shape) { addPoints(getDoubleFromArrayList(x), getDoubleFromArrayList(y), shape); }
/** Adds a curve or set of points to this plot, where 'type' is * "line", "connected circle", "filled", "bar", "separated bar", "circle", "box", "triangle", "diamond", "cross", * "x" or "dot". Run <i>Help>Examples>JavaScript>Graph Types</i> to see examples. * If 'type' is in the form "code: <macroCode>", the macro given is executed to draw the symbol; * macro variables 'x' and 'y' are the pixel coordinates of the point, 'xval' and 'yval' are the plot data * and 'i' is the index of the data point (starting with 0 for the first point in the array). * The drawing including line thickness, font size, etc. be scaled by scale factor 's' (to make high-resolution plots work). * Example: "code: setFont('sanserif',12*s,'bold anti');drawString(d2s(yval,1),x-14*s,y-4*s);" * writes the y value for each point above the point. */ public void add(String type, double[] xvalues, double[] yvalues) { int iShape = toShape(type); addPoints(Tools.toFloat(xvalues), Tools.toFloat(yvalues), null, iShape, iShape==CUSTOM?type.substring(5, type.length()):null); }
/** Adds a set of points to the plot using double arrays. */ public void addPoints(double[] x, double[] y, int shape) { addPoints(Tools.toFloat(x), Tools.toFloat(y), shape); }
/** Adds a curve, set of points or error bars to this plot, where 'type' is * "line", "connected circle", "filled", "bar", "separated bar", "circle", "box", * "triangle", "diamond", "cross", "x", "dot", "error bars" or "xerror bars". */ public void add(String type, double[] yvalues) { int iShape = toShape(type); if (iShape==-1) addErrorBars(yvalues); else if (iShape==-2) addHorizontalErrorBars(yvalues); else addPoints(null, Tools.toFloat(yvalues), null, iShape, iShape==CUSTOM?type.substring(5, type.length()):null); }
/** Adds a set of points to the plot using double ArrayLists. * Must be called before the plot is displayed. */ public void addPoints(ArrayList x, ArrayList y, ArrayList errorBars, int shape) { addPoints(getDoubleFromArrayList(x), getDoubleFromArrayList(y), getDoubleFromArrayList(errorBars), shape); }
/** Adds a set of points to the plot or adds a curve if shape is set to LINE. * @param x the x-coodinates * @param y the y-coodinates * @param errorBars half-lengths of the vertical error bars, may be null * @param shape CIRCLE, X, BOX, TRIANGLE, CROSS, DIAMOND, DOT or LINE */ public void addPoints(double[] x, double[] y, double[] errorBars, int shape) { addPoints(Tools.toFloat(x), Tools.toFloat(y), Tools.toFloat(errorBars), shape, null); }
/** Adds a set of points to the plot using double ArrayLists. * Must be called before the plot is displayed. */ public void addPoints(ArrayList x, ArrayList y, ArrayList errorBars, int shape) { addPoints(getDoubleFromArrayList(x), getDoubleFromArrayList(y), getDoubleFromArrayList(errorBars), shape); }
/** Adds a set of points to the plot or adds a curve if shape is set to LINE. * @param x the x-coodinates * @param y the y-coodinates * @param errorBars half-lengths of the vertical error bars, may be null * @param shape CIRCLE, X, BOX, TRIANGLE, CROSS, DIAMOND, DOT or LINE */ public void addPoints(double[] x, double[] y, double[] errorBars, int shape) { addPoints(Tools.toFloat(x), Tools.toFloat(y), Tools.toFloat(errorBars), shape, null); }
public Plot getPlot() { double[] x = PlotUtils.range(0, series.length - 1); Plot plot = new Plot("Profile", "x", "intensity", x, series); PlotUtils.setLimits(plot, x, series, getX(), getIntensities()); plot.draw(); plot.setColor(Color.BLUE); plot.addPoints(getX(), getIntensities(), Plot.CIRCLE); return plot; } }