Set the view limits to the nearest tick values that contain the data.
(self, dmin, dmax)
| 2033 | return self.raise_if_exceeds(locs) |
| 2034 | |
| 2035 | def view_limits(self, dmin, dmax): |
| 2036 | """ |
| 2037 | Set the view limits to the nearest tick values that contain the data. |
| 2038 | """ |
| 2039 | if mpl.rcParams['axes.autolimit_mode'] == 'round_numbers': |
| 2040 | vmin = self._edge.le(dmin - self._offset) * self._edge.step + self._offset |
| 2041 | vmax = self._edge.ge(dmax - self._offset) * self._edge.step + self._offset |
| 2042 | if vmin == vmax: |
| 2043 | vmin -= 1 |
| 2044 | vmax += 1 |
| 2045 | else: |
| 2046 | vmin = dmin |
| 2047 | vmax = dmax |
| 2048 | |
| 2049 | return mtransforms._nonsingular(vmin, vmax) |
| 2050 | |
| 2051 | |
| 2052 | def scale_range(vmin, vmax, n=1, threshold=100): |