def limits(self):
if self._limits:
return self._limits
elif self.range and not np.isreal(self.range[0]):
// discrete range
return self.range
else:
After Change
elif isinstance(self.range, list):
// discrete range
return self.range
elif isinstance(self.range, np.ndarray):
// discrete limits for a continuous range
mn = int(np.floor(np.min(self.range)))
mx = int(np.ceil(np.max(self.range)))
return range(mn, mx+1)
else:
GgplotError(
"Lost, do not know what the limits are.")
// Discrete position scales should be able to make use of the train
// method bound to continuous scales