/** Adds horizontal error bars to the last data passed to the plot (via the constructor or addPoints). */ public void addHorizontalErrorBars(double[] xErrorBars) { addHorizontalErrorBars(Tools.toFloat(xErrorBars)); }
/** Adds horizontal error bars to the last data passed to the plot (via the constructor or addPoints). */ public void addHorizontalErrorBars(double[] xErrorBars) { addHorizontalErrorBars(Tools.toFloat(xErrorBars)); }
/** 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 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); }
currentPlot.addErrorBars(y); else if (what==-2) currentPlot.addHorizontalErrorBars(y); else if (errorBars) currentPlot.addPoints(x, y, e, what);
currentPlot.addErrorBars(y); else if (what==-2) currentPlot.addHorizontalErrorBars(y); else if (errorBars) currentPlot.addPoints(x, y, e, what);
/** For "Add from Table" and "Add from Arrays" adds item to the plot according to the current Choice settings * and sets the Style fields for it. */ private void addObjectFromTable() { float[][] data = getDataArrays(); if (data[1] == null) return; //no y data? then can't plot String label = columnChoice[1].getSelectedItem(); //take label from y int shape = Plot.toShape(symbolChoice.getSelectedItem()); float lineWidth = (float)(Tools.parseDouble(widthField.getText())); if (lineWidth > 0) plot.setLineWidth(lineWidth); plot.restorePlotObjects(); if (savedLimits != null) plot.setLimits(savedLimits); plot.setColor(colorField.getText(), color2Field.getText()); plot.addPoints(data[0], data[1], data[3], shape, label); if (data[2] != null) plot.addHorizontalErrorBars(data[2]); if (creatingPlot) { plot.setXYLabels(data[0]==null ? "x" : columnChoice[0].getSelectedItem(), columnChoice[1].getSelectedItem()); plot.setLimitsToFit(false); } else plot.fitRangeToLastPlotObject(); currentObjectIndex = plot.getNumPlotObjects()-1; setDialogStyleFields(currentObjectIndex); if (dialogType == ADD_FROM_TABLE) previousTableName = allTableNames[tableChoice.getSelectedIndex()]; }
/** For "Add from Table" and "Add from Arrays" adds item to the plot according to the current Choice settings * and sets the Style fields for it. */ private void addObjectFromTable() { float[][] data = getDataArrays(); if (data[1] == null) return; //no y data? then can't plot String label = columnChoice[1].getSelectedItem(); //take label from y int shape = Plot.toShape(symbolChoice.getSelectedItem()); float lineWidth = (float)(Tools.parseDouble(widthField.getText())); if (lineWidth > 0) plot.setLineWidth(lineWidth); plot.restorePlotObjects(); if (savedLimits != null) plot.setLimits(savedLimits); plot.setColor(colorField.getText(), color2Field.getText()); plot.addPoints(data[0], data[1], data[3], shape, label); if (data[2] != null) plot.addHorizontalErrorBars(data[2]); if (creatingPlot) { plot.setXYLabels(data[0]==null ? "x" : columnChoice[0].getSelectedItem(), columnChoice[1].getSelectedItem()); plot.setLimitsToFit(false); } else plot.fitRangeToLastPlotObject(); currentObjectIndex = plot.getNumPlotObjects()-1; setDialogStyleFields(currentObjectIndex); if (dialogType == ADD_FROM_TABLE) previousTableName = allTableNames[tableChoice.getSelectedIndex()]; }