当前位置: 首页>>代码示例>>Java>>正文


Java Plot.setLimits方法代码示例

本文整理汇总了Java中ij.gui.Plot.setLimits方法的典型用法代码示例。如果您正苦于以下问题:Java Plot.setLimits方法的具体用法?Java Plot.setLimits怎么用?Java Plot.setLimits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ij.gui.Plot的用法示例。


在下文中一共展示了Plot.setLimits方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: drawFlinnPlot

import ij.gui.Plot; //导入方法依赖的package包/类
/**
 * Display each ellipsoid's axis ratios in a scatter plot
 *
 * @param title
 * @param ellipsoids
 * @return
 */
private ImagePlus drawFlinnPlot(final String title, final Ellipsoid[] ellipsoids) {

	final int l = ellipsoids.length;
	final double[] aOverB = new double[l];
	final double[] bOverC = new double[l];

	for (int i = 0; i < l; i++) {
		final double[] radii = ellipsoids[i].getSortedRadii();
		aOverB[i] = radii[0] / radii[1];
		bOverC[i] = radii[1] / radii[2];
	}

	final Plot plot = new Plot("Flinn Diagram of " + title, "b/c", "a/b");
	plot.setLimits(0, 1, 0, 1);
	plot.setSize(1024, 1024);
	plot.addPoints(bOverC, aOverB, Plot.CIRCLE);
	final ImageProcessor plotIp = plot.getProcessor();
	final ImagePlus plotImage = new ImagePlus("Flinn Diagram of " + title, plotIp);
	return plotImage;
}
 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:28,代码来源:EllipsoidFactor.java

示例2: showPlot

import ij.gui.Plot; //导入方法依赖的package包/类
/**
 * Display a graph showing connectivity vs. threshold
 *
 * @param testThreshold
 * @param conns
 */
private void showPlot(final double[] testThreshold, final double[] conns) {
	// convert arrays to floats
	final int nPoints = testThreshold.length;
	final float[] xData = new float[nPoints];
	final float[] yData = new float[nPoints];
	double xMin = Double.MAX_VALUE;
	double xMax = Double.MIN_VALUE;
	double yMax = Double.MIN_VALUE;
	for (int i = 0; i < nPoints; i++) {
		xData[i] = (float) testThreshold[i];
		yData[i] = (float) conns[i];
		xMin = Math.min(xMin, xData[i]);
		xMax = Math.max(xMax, xData[i]);
		yMax = Math.max(yMax, yData[i]);
	}
	final Plot plot = new Plot("Connectivity vs. Threshold", "Threshold", "Connectivity", xData, yData);
	plot.addPoints(xData, yData, Plot.CIRCLE);
	plot.setLimits(xMin, xMax, 0, yMax);
	plot.draw();
	final ImageProcessor plotIp = plot.getProcessor();
	final ImagePlus plotImage = new ImagePlus();
	plotImage.setProcessor("Connectivity vs. Threshold", plotIp);
	plotImage.show();
}
 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:31,代码来源:ThresholdMinConn.java

示例3: createPlot

import ij.gui.Plot; //导入方法依赖的package包/类
public static Plot createPlot(double [] yValues, String title, String xLabel, String yLabel){
	double [] xValues = new double [yValues.length];
	double min = Double.MAX_VALUE;
	double max = -Double.MAX_VALUE;
	for (int i = 0; i < xValues.length; i ++){
		min = (yValues[i] < min) ? yValues[i] : min;
		max = (yValues[i] > max) ? yValues[i] : max;
		xValues[i] = i + 1;
	}
	if (min == max){
		max++;
	}
	Plot plot = new Plot(title, xLabel, yLabel, xValues, yValues, Plot.DEFAULT_FLAGS);
	plot.setLimits(1, xValues.length, min, max);
	return plot;
}
 
开发者ID:akmaier,项目名称:CONRAD,代码行数:17,代码来源:VisualizationUtil.java

示例4: createPlot

import ij.gui.Plot; //导入方法依赖的package包/类
public static Plot createPlot(double [] xValues, double [] yValues, String title, String xLabel, String yLabel){
	double miny = Double.MAX_VALUE;
	double maxy = -Double.MAX_VALUE;
	double minx = Double.MAX_VALUE;
	double maxx = -Double.MAX_VALUE;
	for (int i = 0; i < xValues.length; i ++){
		miny = (yValues[i] < miny) ? yValues[i] : miny;
		maxy = (yValues[i] > maxy) ? yValues[i] : maxy;
		minx = (xValues[i] < minx) ? xValues[i] : minx;
		maxx = (xValues[i] > maxx) ? xValues[i] : maxx;

	}
	if (miny == maxy){
		maxy++;
	}
	if (minx == maxx){
		maxx++;
	}
	Plot plot = new Plot(title, xLabel, yLabel, xValues, yValues, Plot.DEFAULT_FLAGS);
	plot.setLimits(minx, maxx, miny, maxy);
	return plot;
}
 
开发者ID:akmaier,项目名称:CONRAD,代码行数:23,代码来源:Measure_MTF_Wire.java

示例5: showHistogram

import ij.gui.Plot; //导入方法依赖的package包/类
private void showHistogram(String name, double[] values, int bins, Statistics stats, WindowOrganiser wo)
{
	DoubleData data = new StoredData(values, false);
	double minWidth = 0;
	int removeOutliers = 0;
	int shape = Plot.CIRCLE; // Plot2.BAR; // A bar chart confuses the log plot since it plots lines to zero.
	String label = String.format("Mean = %s +/- %s", Utils.rounded(stats.getMean()),
			Utils.rounded(stats.getStandardDeviation()));
	int id = Utils.showHistogram(TITLE, data, name, minWidth, removeOutliers, bins, shape, label);
	if (Utils.isNewWindow())
		wo.add(id);
	// Redraw using a log scale. This requires a non-zero y-min
	Plot plot = Utils.plot;
	double[] limits = plot.getLimits();
	plot.setLimits(limits[0], limits[1], 1, limits[3]);
	plot.setAxisYLog(true);
	Utils.plot.updateImage();
}
 
开发者ID:aherbert,项目名称:GDSC-SMLM,代码行数:19,代码来源:CMOSAnalysis.java

示例6: 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);
}
 
开发者ID:aherbert,项目名称:GDSC-SMLM,代码行数:25,代码来源:DoubletAnalysis.java

示例7: createPlot

import ij.gui.Plot; //导入方法依赖的package包/类
private Plot createPlot(double[] distances, double[] values, Color color, Color avColor, String title,
		String xLabel, String yLabel, double[] spacedX, double[] ceroValuesX, double[] ceroValuesY, double[] spacedY)
{
	float[] dummy = null;
	Plot plot = new Plot(title, xLabel.concat(pixelsUnitString), yLabel, dummy, dummy, Plot.X_NUMBERS +
			Plot.Y_NUMBERS + Plot.X_TICKS + Plot.Y_TICKS);

	double min = 0;
	for (double d : values)
	{
		if (min > d)
			min = d;
	}

	plot.setLimits(0.0D, maximumRadius, min, 1.0D);
	plot.setColor(color);
	plot.addPoints(distances, values, Plot.X);
	addAverage(plot, distances, values, avColor);
	plot.setColor(Color.black);
	plot.addPoints(spacedX, ceroValuesX, 5);
	plot.addPoints(ceroValuesY, spacedY, 5);
	return plot;
}
 
开发者ID:aherbert,项目名称:GDSC,代码行数:24,代码来源:CDA_Plugin.java

示例8: makePlot

import ij.gui.Plot; //导入方法依赖的package包/类
static public Plot makePlot(final CATAParameters cp, final String name, final VectorString3D c) {
	final double[] stdDev = c.getStdDevAtEachPoint();
	if (null == stdDev) return null;
	final double[] index = new double[stdDev.length];
	for (int i=0; i<index.length; i++) index[i] = i;
	Utils.log2("name is " + name);
	Utils.log2("c is " + c);
	Utils.log2("cp is " + cp);
	Utils.log2("stdDev is " + stdDev);
	Utils.log2("c.getCalibrationCopy() is " + c.getCalibrationCopy());
	Utils.log2("c.getDelta() is " + c.getDelta());
	final Calibration cal = c.getCalibrationCopy();
	if (null == cal) Utils.log2("WARNING null calibration!");
	final Plot plot = new Plot(name, name + " -- Point index (delta: " + Utils.cutNumber(c.getDelta(), 2) + " " + (null == cal ? "pixels" : cal.getUnits()) + ")", "Std Dev", index, stdDev);
	plot.setLimits(0, cp.plot_max_x, 0, cp.plot_max_y);
	plot.setSize(cp.plot_width, cp.plot_height);
	plot.setLineWidth(2);
	return plot;
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:20,代码来源:Compare.java

示例9: createGraph

import ij.gui.Plot; //导入方法依赖的package包/类
/**
 * Create a graph for plotting anisotropy results
 *
 * @param id
 *            Identification string for Anisotropy plot
 * @return ImagePlus for drawing a plot on
 */
private ImagePlus createGraph(final String id) {
	final double[] x = { 0 }, y = { 0 };
	final Plot plot = new Plot("Anisotropy", "Repeats", "Anisotropy", x, y);
	plot.setLimits(0, 1, 0, 1);
	final ImageProcessor plotIp = plot.getProcessor();
	final ImagePlus plotImage = new ImagePlus("Anisotropy of " + id, plotIp);
	plotImage.setProcessor(null, plotIp);
	return plotImage;
}
 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:17,代码来源:Anisotropy.java

示例10: updateGraph

import ij.gui.Plot; //导入方法依赖的package包/类
/**
 * Draw on plotImage the data in anisotropyHistory with error bars from
 * errorHistory
 *
 * @param plotImage
 *            the graph image
 * @param anisotropyHistory
 *            all anisotropy results, 1 for each iteration
 * @param errorHistory
 *            all error results, 1 for each iteration
 */
private void updateGraph(final ImagePlus plotImage, final Vector<Double> anisotropyHistory,
		final Vector<Double> errorHistory) {
	final double[] yVariables = new double[anisotropyHistory.size()];
	final double[] xVariables = new double[anisotropyHistory.size()];
	final Enumeration<Double> e = anisotropyHistory.elements();
	int i = 0;
	while (e.hasMoreElements()) {
		yVariables[i] = e.nextElement();
		xVariables[i] = i;
		i++;
	}
	final Enumeration<Double> f = errorHistory.elements();
	i = 0;
	final double[] errorBars = new double[errorHistory.size()];
	while (f.hasMoreElements()) {
		errorBars[i] = f.nextElement();
		i++;
	}
	final Plot plot = new Plot("Anisotropy", "Number of repeats", "Anisotropy", xVariables, yVariables);
	plot.addPoints(xVariables, yVariables, Plot.X);
	plot.addErrorBars(errorBars);
	plot.setLimits(0, anisotropyHistory.size(), 0, 1);
	final ImageProcessor plotIp = plot.getProcessor();
	plotImage.setProcessor(null, plotIp);
	return;
}
 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:38,代码来源:Anisotropy.java

示例11: drawSigmaPlots

import ij.gui.Plot; //导入方法依赖的package包/类
@Override
public void drawSigmaPlots() {
    // config
    SigmaPlotConfig cfg = new SigmaPlotConfig();
    cfg.allFrames = allFrames;
    cfg.allSigma1s = allSigma1s;
    cfg.allSigma2s = allSigma2s;
    cfg.allPolynomsS1 = allPolynomsS1;
    cfg.allPolynomsS2 = allPolynomsS2;
    cfg.polynomS1Final = polynomS1Final;
    cfg.polynomS2Final = polynomS2Final;
    cfg.allSigma1sColor = new Color(255, 200, 200);
    cfg.allSigma2sColor = new Color(200, 200, 255);
    cfg.allPolynomsS1Color = new Color(255, 230, 230);
    cfg.allPolynomsS2Color = new Color(230, 230, 255);
    cfg.polynomS1FinalColor = new Color(255, 0, 0);
    cfg.polynomS2FinalColor = new Color(0, 0, 255);
    cfg.legend1X = 0.1;
    cfg.legend1Y = 0.8;
    cfg.legend1Label = "sigma1";
    cfg.legend2X = 0.1;
    cfg.legend2Y = 0.9;
    cfg.legend2Label = "sigma2";

    // create and setup plot
    Plot plot = new Plot("Sigma", "z [nm]", "sigma [px]", null, (float[]) null);
    plot.setSize(1024, 768);
    plot.setLimits(-2*zRange, +2*zRange, 0, stageStep);
    double[] xVals = new double[(int)(2*zRange/stageStep) * 2 + 1];
    for(int val = -2*(int)zRange, i = 0; val <= +2*(int)zRange; val += stageStep, i++) {
        xVals[i] = val;
    }
    plot.draw();

    // plot
    drawSigmaPlots(plot, xVals, cfg);

    // display
    plot.show();
}
 
开发者ID:zitmen,项目名称:thunderstorm,代码行数:41,代码来源:AbstractCalibrationProcess.java

示例12: 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();
}
 
开发者ID:zitmen,项目名称:thunderstorm,代码行数:35,代码来源:ResultsDriftCorrection.java

示例13: showModel

import ij.gui.Plot; //导入方法依赖的package包/类
protected static void showModel(FuzzySobelModel model) {
	double bins[] = new double[256];
	for (int i = 0; i < bins.length; i++) {
		bins[i] = i;
	}
	Plot plot = new Plot("Fuzzy edge model", "Pixel magnitude", "Membership", bins, model.getMuSmoot());
	plot.setColor(Color.RED);
	plot.addPoints(bins, model.getMuEdge(), Plot.LINE);
	plot.setColor(Color.BLUE);
	plot.addLegend("Smooth\nEdge");
	plot.setLimits(0.0, 255.0, 0.0, 1.0);
	plot.draw();
	plot.show();
}
 
开发者ID:LoreScianatico,项目名称:FuzzyImageToolBox,代码行数:15,代码来源:AbstractFuzzySobelPlugin.java

示例14: main

import ij.gui.Plot; //导入方法依赖的package包/类
public static void main(String[] args){
	
	// Define Point Cloud 
	SimpleMatrix p_k = new SimpleMatrix(4,2);
	SimpleMatrix q_k = new SimpleMatrix(4,2);
	
	p_k.setRowValue(0, new SimpleVector(1,2));
	p_k.setRowValue(1, new SimpleVector(3,6));
	p_k.setRowValue(2, new SimpleVector(4,6));
	p_k.setRowValue(3, new SimpleVector(3,4));
	
	q_k.setRowValue(0, new SimpleVector(-0.7, 2.1));
	q_k.setRowValue(1, new SimpleVector(-2.1, 6.4));
	q_k.setRowValue(2, new SimpleVector(-1.4, 7.1));
	q_k.setRowValue(3, new SimpleVector(-0.7, 4.9));
	
	// Plot Point Cloud
	Plot plot = new Plot("Regression Line", "X", "Y", Plot.DEFAULT_FLAGS);
	plot.setLimits(-10, 10, -10, 10);
	plot.addPoints(p_k.getCol(0).copyAsDoubleArray(), p_k.getCol(1).copyAsDoubleArray(), Plot.BOX);
	plot.addPoints(q_k.getCol(0).copyAsDoubleArray(), q_k.getCol(1).copyAsDoubleArray(), Plot.CIRCLE);
	
	// Calculate registration parameter
	Registration1 reg = new Registration1();
	SimpleVector parameter = reg.registrationUsingPointCorrespondences(p_k, q_k);
	
	// Rotation and translation
	double phi = parameter.getElement(0);
	SimpleVector translation = new SimpleVector(parameter.getElement(1), parameter.getElement(2));
	
	// Transform points
	SimpleMatrix transformedPoints = reg.applyTransform(q_k, phi, translation);
	
	// Add transformed point cloud to the plot
	plot.addPoints(transformedPoints.getCol(0).copyAsDoubleArray(), transformedPoints.getCol(1).copyAsDoubleArray(), Plot.CROSS);
	plot.show();
	
}
 
开发者ID:akmaier,项目名称:CONRAD,代码行数:39,代码来源:Registration1.java

示例15: 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);
}
 
开发者ID:aherbert,项目名称:GDSC-SMLM,代码行数:12,代码来源:FailCountManager.java


注:本文中的ij.gui.Plot.setLimits方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。