Sets the plot range to encompass all data. Updates the image if existing and updateImg is true.
(boolean updateImg)
| 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() { |
no test coverage detected