def __call__(self):
locations = LinearLocator.__call__(self)
new_locations = []
for location in locations:
if np.absolute(location) < 0.01:
new_locations.append(float("{:.1e}".format(location)))
else:
new_locations.append(np.round(location, 3))
if np.isclose(new_locations[-1], self.max_val) or new_locations[-1] >= self.max_val:
new_locations[-1] = self.max_val
if new_locations[0] <= self.min_val:
new_locations[0] = self.min_val
return new_locations
评论列表
文章目录