/** Replaces the specified plot object (curve or set of points). Equivalent to add() if there are no plot objects. */ public void replace(int index, String type, double[] xvalues, double[] yvalues) { if (index>=0 && index<allPlotObjects.size()) { objectToReplace = allPlotObjects.size()>0?index:-1; add(type, xvalues, yvalues); } }
currentPlot.addPoints(x, y, e, what); else if (what==Plot.CUSTOM) currentPlot.add(shape, x, y); else currentPlot.addPoints(x, y, what);
/** Plots a histogram of this image using the specified number of bins and returns the PlotWindow. */ public PlotWindow plotHistogram(int bins) { ImageStatistics stats = getStatistics(AREA+MEAN+MODE+MIN_MAX, bins); Plot plot = new Plot("Hist_"+getTitle(), "Value", "Frequency"); plot.setColor("black", "#999999"); plot.setFont(new Font("SansSerif",Font.PLAIN,14)); double[] y = stats.histogram(); int n = y.length; double[] x = new double[n]; int bits = getBitDepth(); boolean eightBit = bits==8 || bits==24; double min = !eightBit?stats.min:0; for (int i=0; i<n; i++) x[i] = min+i*stats.binSize; plot.add("bar", x, y); if (bins!=256) plot.addLegend(bins+" bins", "auto"); if (eightBit) plot.setLimits(0,256,0,Double.NaN); return plot.show(); }
currentPlot.addPoints(x, y, e, what); else if (what==Plot.CUSTOM) currentPlot.add(shape, x, y); else currentPlot.addPoints(x, y, what);
/** Plots a histogram of this image using the specified number of bins and returns the PlotWindow. */ public PlotWindow plotHistogram(int bins) { ImageStatistics stats = getStatistics(AREA+MEAN+MODE+MIN_MAX, bins); Plot plot = new Plot("Hist_"+getTitle(), "Value", "Frequency"); plot.setColor("black", "#999999"); plot.setFont(new Font("SansSerif",Font.PLAIN,14)); double[] y = stats.histogram(); int n = y.length; double[] x = new double[n]; int bits = getBitDepth(); boolean eightBit = bits==8 || bits==24; double min = !eightBit?stats.min:0; for (int i=0; i<n; i++) x[i] = min+i*stats.binSize; plot.add("bar", x, y); if (bins!=256) plot.addLegend(bins+" bins", "auto"); if (eightBit) plot.setLimits(0,256,0,Double.NaN); return plot.show(); }
/** Replaces the specified plot object (curve or set of points). Equivalent to add() if there are no plot objects. */ public void replace(int index, String type, double[] xvalues, double[] yvalues) { if (index>=0 && index<allPlotObjects.size()) { objectToReplace = allPlotObjects.size()>0?index:-1; add(type, xvalues, yvalues); } }
histo[index]++; add("bar", xValues, histo);
histo[index]++; add("bar", xValues, histo);