MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / fitRangeToLastPlotObject

Method fitRangeToLastPlotObject

ij/src/main/java/ij/gui/Plot.java:2413–2423  ·  view source on GitHub ↗

Enlarges the current minimum and maximum ranges to include the data range of the last plotObject added, if it is an XY_DATA or ARROWS plotObject. Does not set the new limits as default, does not redraw the plot.

()

Source from the content-addressed store, hash-verified

2411 * if it is an XY_DATA or ARROWS plotObject.
2412 * Does not set the new limits as default, does not redraw the plot. */
2413 void fitRangeToLastPlotObject() {
2414 if (allPlotObjects.size() < 1) return;
2415 PlotObject plotObject = allPlotObjects.lastElement();
2416 if (Double.isNaN(currentMinMax[0]) || Double.isNaN(currentMinMax[2])) { // no range determined yet?
2417 setLimitsToFit(false);
2418 } else { //we have min&max already, just extend the range if necessary
2419 enlargeRange = new int[currentMinMax.length];
2420 getMinAndMax(currentMinMax, enlargeRange, plotObject, ALL_AXES_RANGE);
2421 enlargeRange(currentMinMax);
2422 }
2423 }
2424
2425 /** Gets the minimum and maximum values from an XY_DATA or ARROWS plotObject;
2426 * axisRangeFlags determine for which axis (X_RANGE for x axis, Y_RANGE for y axis)

Callers 2

addObjectFromPlotMethod · 0.80
addObjectFromTableMethod · 0.80

Calls 4

setLimitsToFitMethod · 0.95
getMinAndMaxMethod · 0.95
enlargeRangeMethod · 0.95
sizeMethod · 0.45

Tested by

no test coverage detected