/** Adds an automatically positioned legend, where 'labels' can be a tab-delimited or newline-delimited list of curve or point labels in the sequence these data were added. Hidden data sets are ignored. If 'labels' is null or empty, the labels of the data set previously (if any) are used. To modify the legend's style, call 'setFont' and 'setLineWidth' before 'addLegend'. */ public void addLegend(String labels) { addLegend(labels, null); }
/** Adds an automatically positioned legend, where 'labels' can be a tab-delimited or newline-delimited list of curve or point labels in the sequence these data were added. Hidden data sets are ignored. If 'labels' is null or empty, the labels of the data set previously (if any) are used. To modify the legend's style, call 'setFont' and 'setLineWidth' before 'addLegend'. */ public void addLegend(String labels) { addLegend(labels, null); }
double addPlotLegend(Plot plot) { String labels = getFirstString(); String options = null; if (interp.nextToken()!=')') options = getLastString(); else interp.getRightParen(); plot.setColor(Color.BLACK); plot.setLineWidth(1); plot.addLegend(labels, options); return Double.NaN; }
double addPlotLegend(Plot plot) { String labels = getFirstString(); String options = null; if (interp.nextToken()!=')') options = getLastString(); else interp.getRightParen(); plot.setColor(Color.BLACK); plot.setLineWidth(1); plot.addLegend(labels, options); return Double.NaN; }
p.addLegend("FRC\nSmoothed FRC\nThreshold");
/** 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(); }
/** 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(); }