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

Method setLimitsToFit

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

Sets the plot range to encompass all data. Updates the image if existing and updateImg is true.

(boolean updateImg)

Source from the content-addressed store, hash-verified

1641
1642 /** Sets the plot range to encompass all data. Updates the image if existing and updateImg is true. */
1643 public void setLimitsToFit(boolean updateImg) {
1644 saveMinMax();
1645 currentMinMax = getMinAndMax(true, ALL_AXES_RANGE);
1646 if (Double.isNaN(defaultMinMax[0]) && Double.isNaN(defaultMinMax[2])) //no range at all so far
1647 System.arraycopy(currentMinMax, 0, defaultMinMax, 0, Math.min(currentMinMax.length, defaultMinMax.length));
1648
1649 enlargeRange(currentMinMax); //avoid points exactly at the border
1650 //System.arraycopy(currentMinMax, 0, defaultMinMax, 0, currentMinMax.length);
1651 if (plotDrawn && updateImg) updateImage();
1652 }
1653
1654 /** reverts plot range to previous values and updates the image */
1655 public void setPreviousMinMax() {

Callers 8

doPlotMethod · 0.95
analyzeMethod · 0.95
zoomOnRangeArrowMethod · 0.95
actionPerformedMethod · 0.80
zoomMethod · 0.80
addObjectFromTableMethod · 0.80
updateXYValueMethod · 0.80

Calls 6

saveMinMaxMethod · 0.95
getMinAndMaxMethod · 0.95
enlargeRangeMethod · 0.95
updateImageMethod · 0.95
arraycopyMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected