本文整理汇总了Java中ij.gui.Plot.addLabel方法的典型用法代码示例。如果您正苦于以下问题:Java Plot.addLabel方法的具体用法?Java Plot.addLabel怎么用?Java Plot.addLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.gui.Plot
的用法示例。
在下文中一共展示了Plot.addLabel方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: plotJaccard
import ij.gui.Plot; //导入方法依赖的package包/类
private void plotJaccard(ResidualsScore residualsScore, ResidualsScore residualsScoreReference)
{
String title = TITLE + " Score";
Plot plot = new Plot(title, "Residuals", "Score");
double max = getMax(0.01, residualsScore);
if (residualsScoreReference != null)
{
max = getMax(max, residualsScore);
}
plot.setLimits(0, 1, 0, max * 1.05);
addLines(plot, residualsScore, 1);
if (residualsScoreReference != null)
{
addLines(plot, residualsScoreReference, 0.5);
}
plot.setColor(Color.black);
plot.addLabel(0, 0,
String.format("Residuals %s; Jaccard %s (Black); Precision %s (Blue); Recall %s (Red)",
Utils.rounded(residualsScore.residuals[residualsScore.maxJaccardIndex]),
Utils.rounded(residualsScore.jaccard[residualsScore.maxJaccardIndex]),
Utils.rounded(residualsScore.precision[residualsScore.maxJaccardIndex]),
Utils.rounded(residualsScore.recall[residualsScore.maxJaccardIndex])));
display(title, plot);
}
示例2: drawSigmaPlots
import ij.gui.Plot; //导入方法依赖的package包/类
protected static void drawSigmaPlots(Plot plot, double[] xVals, SigmaPlotConfig cfg) {
// add points
plot.setColor(cfg.allSigma1sColor);
plot.addPoints(cfg.allFrames, cfg.allSigma1s, Plot.CROSS);
plot.setColor(cfg.allSigma2sColor);
plot.addPoints(cfg.allFrames, cfg.allSigma2s, Plot.CROSS);
// add polynomials
for(int i = 0; i < cfg.allPolynomsS1.size(); i++) {
double[] sigma1Vals = new double[xVals.length];
double[] sigma2Vals = new double[xVals.length];
for(int j = 0; j < sigma1Vals.length; j++) {
sigma1Vals[j] = cfg.allPolynomsS1.get(i).value(xVals[j]);
sigma2Vals[j] = cfg.allPolynomsS2.get(i).value(xVals[j]);
}
plot.setColor(cfg.allPolynomsS1Color);
plot.addPoints(xVals, sigma1Vals, Plot.LINE);
plot.setColor(cfg.allPolynomsS2Color);
plot.addPoints(xVals, sigma2Vals, Plot.LINE);
}
// add final fitted curves
double[] sigma1ValsAll = new double[xVals.length];
double[] sigma2ValsAll = new double[xVals.length];
for(int j = 0; j < sigma1ValsAll.length; j++) {
sigma1ValsAll[j] = cfg.polynomS1Final.value(xVals[j]);
sigma2ValsAll[j] = cfg.polynomS2Final.value(xVals[j]);
}
plot.setColor(cfg.polynomS1FinalColor);
plot.addPoints(xVals, sigma1ValsAll, Plot.LINE);
plot.setColor(cfg.polynomS2FinalColor);
plot.addPoints(xVals, sigma2ValsAll, Plot.LINE);
//legend
plot.setColor(cfg.polynomS1FinalColor);
plot.addLabel(cfg.legend1X, cfg.legend1Y, cfg.legend1Label);
plot.setColor(cfg.polynomS2FinalColor);
plot.addLabel(cfg.legend2X, cfg.legend2Y, cfg.legend2Label);
}
示例3: showDriftPlot
import ij.gui.Plot; //导入方法依赖的package包/类
public static void showDriftPlot(DriftResults driftCorrection) {
int minFrame = driftCorrection.getMinFrame();
int maxFrame = driftCorrection.getMaxFrame();
int gridTicks = 200;
double tickStep = (maxFrame - minFrame) / (double) gridTicks;
double[] grid = new double[gridTicks];
double[] driftX = new double[gridTicks];
double[] driftY = new double[gridTicks];
for(int i = 0; i < gridTicks; i++) {
grid[i] = i * tickStep + minFrame;
Point2D.Double offset = driftCorrection.getInterpolatedDrift(grid[i]);
driftX[i] = offset.x;
driftY[i] = offset.y;
}
Plot plot = new Plot("Drift", "frame", "drift [" + driftCorrection.getUnits() + "]", (float[]) null, null);
if(driftCorrection.getDriftDataX().length > 50) {
plot.setFrameSize(1280, 720);
}
plot.setLimits(minFrame, driftCorrection.getMaxFrame(),
Math.min(VectorMath.min(driftCorrection.getDriftDataX()), VectorMath.min(driftCorrection.getDriftDataY())),
Math.max(VectorMath.max(driftCorrection.getDriftDataX()), VectorMath.max(driftCorrection.getDriftDataY())));
plot.setColor(new Color(255, 128, 128));
plot.addPoints(driftCorrection.getDriftDataFrame(), driftCorrection.getDriftDataX(), Plot.CROSS);
plot.draw();
plot.setColor(new Color(128, 255, 128));
plot.addPoints(driftCorrection.getDriftDataFrame(), driftCorrection.getDriftDataY(), Plot.CROSS);
plot.setColor(Color.red);
plot.addPoints(grid, driftX, Plot.LINE);
plot.addLabel(0.05, 0.8, "x drift");
plot.setColor(Color.green);
plot.addPoints(grid, driftY, Plot.LINE);
plot.addLabel(0.05, 0.9, "y drift");
plot.show();
}
示例4: display
import ij.gui.Plot; //导入方法依赖的package包/类
private void display(WindowOrganiser wo, String string, float[] x, float[] y, boolean fixedXAxis)
{
String title = TITLE + " " + string;
Plot plot = new Plot(title, "Candidate", string);
double maxx = (fixedXAxis) ? maxSize : x[x.length - 1];
double maxy = Maths.max(y);
plot.setLimits(x[0], maxx, 0, maxy * 1.05);
plot.addPoints(x, y, Plot.LINE);
plot.addLabel(0, 0, "Max = " + maxy);
Utils.display(title, plot, 0, wo);
}
示例5: draw
import ij.gui.Plot; //导入方法依赖的package包/类
private void draw(WindowOrganiser wo)
{
_msdThreshold = dThreshold;
_normalise = normalise;
// Find the index in the MSD array
int index = Arrays.binarySearch(d, _msdThreshold);
if (index < 0)
index = -index - 1;
_index = index;
// Histogram the distributions
computeHistogram(0, index, length, h1);
computeHistogram(index, length.length, length, h2);
int sum1 = (int) Maths.sum(h1);
int sum2 = (int) Maths.sum(h2);
float max1 = createHistogramValues(h1, (_normalise) ? sum1 : 1, y1);
float max2 = createHistogramValues(h2, (_normalise) ? sum2 : 2, y2);
String title = "Trace length distribution";
Plot plot = new Plot(title, "Length", "Frequency");
plot.setLimits(minX, maxX, 0, Math.max(max1, max2) * 1.05);
plot.setColor(Color.red);
plot.addPoints(x1, y1, Plot.LINE);
plot.setColor(Color.blue);
plot.addPoints(x2, y2, Plot.LINE);
plot.setColor(Color.black);
double p = 100.0 * sum1 / (sum1 + sum2);
plot.addLabel(0, 0, String.format("Fixed (red) = %d (%s%%), Moving (blue) = %d (%s%%)", sum1, Utils.rounded(p),
sum2, Utils.rounded(100 - p)));
PlotWindow pw = Utils.display(title, plot, Utils.NO_TO_FRONT);
if (wo != null)
{
// First call with the window organiser put at the front
pw.toFront();
if (Utils.isNewWindow())
wo.add(pw);
}
}
示例6: showPairCorrelation
import ij.gui.Plot; //导入方法依赖的package包/类
private PlotWindow showPairCorrelation(PC pc)
{
double avDensity = (double) pc.n / pc.area;
String title = "Pair Correlation";
Plot plot2 = new Plot(TITLE + " " + title, "r (px)", "g(r)", pc.r, pc.pcf);
plot2.setColor(Color.red);
plot2.drawLine(pc.r[0], 1, pc.r[pc.r.length - 1], 1);
plot2.addLabel(0, 0, "Av.Density = " + IJ.d2s(avDensity, -3) + " px^-2");
plot2.setColor(Color.blue);
return Utils.display(TITLE + " " + title, plot2);
}
示例7: mouseClicked
import ij.gui.Plot; //导入方法依赖的package包/类
/**
* Performs the showing for a particular voxel,when this one is marked by
* the mouse
*/
public void mouseClicked(MouseEvent e) {
ip = IJ.getImage();
canvas = ip.getCanvas();
int offscreenX = canvas.offScreenX(e.getX());
int offscreenY = canvas.offScreenY(e.getY());
VoxelT2 v = VoxelT2.VoxelSearch(voxels, offscreenX, offscreenY,
ip.getSlice());
if (v != null) {
double[] x = new double[v.contrastRaw.length], y = new double[x.length];
for (int i = 0; i < x.length; i++)
x[i] = i;
y = v.contrastRaw;
Plot chart = new Plot("slice:" + ip.getSlice() + " x:"
+ offscreenX + " y:" + offscreenY, "Time", "Contrast", x,
y);
if (pw == null) {
pw = chart.show();
pw.addWindowListener(this);
} else
pw.setTitle("slice:" + ip.getSlice() + " x:" + offscreenX
+ " y:" + offscreenY);
chart.setColor(java.awt.Color.BLUE);
chart.addPoints(x, v.contrastFitted, PlotWindow.LINE);
chart.addLabel(0.75, 0.2, "� Fitted Contrast");
chart.setColor(java.awt.Color.BLACK);
chart.addLabel(0.75, 0.1, "� Raw Contrast");
pw.drawPlot(chart);
} else if (showMove.isSelected() == false)
IJ.showMessage("No meaningful contrast");
}
示例8: plotResults
import ij.gui.Plot; //导入方法依赖的package包/类
private void plotResults(ArrayList<ColocalisationThreshold.ThresholdResult> results)
{
if (results == null)
return;
double[] threshold = new double[results.size()];
double[] R = new double[results.size()];
double[] R2 = new double[results.size()];
double yMin = 1, yMax = -1;
// Plot the zero threshold result at the minimum threshold value
int minThreshold = Integer.MAX_VALUE;
int zeroThresholdIndex = 0;
for (int i = 0, j = results.size() - 1; i < results.size(); i++, j--)
{
ColocalisationThreshold.ThresholdResult result = results.get(i);
threshold[j] = result.threshold1;
R[j] = result.r;
R2[j] = result.r2;
if (yMin > R[j])
yMin = R[j];
if (yMin > R2[j])
yMin = R2[j];
if (yMax < R[j])
yMax = R[j];
if (yMax < R2[j])
yMax = R2[j];
if (result.threshold1 == 0)
{
zeroThresholdIndex = j;
}
else if (minThreshold > result.threshold1)
{
minThreshold = result.threshold1;
}
}
threshold[zeroThresholdIndex] = (minThreshold > 0) ? minThreshold - 1 : 0;
if (rPlot != null && rPlot.isVisible())
rPlot.close();
Plot plot = new Plot(correlationValuesTitle, "Threshold", "R", threshold, R);
plot.setLimits(threshold[0], threshold[threshold.length - 1], yMin, yMax);
plot.setColor(Color.BLUE);
plot.draw();
plot.setColor(Color.RED);
plot.addPoints(threshold, R2, Plot.CROSS);
plot.setColor(Color.BLACK);
plot.addLabel(0, 0, "Blue=C1+C2 above threshold; Red=Ch1/Ch2 below threshold");
rPlot = plot.show();
}