Skip to content

Commit

Permalink
Merge pull request #9 from ianhi/autoscale
Browse files Browse the repository at this point in the history
Always autoscale
  • Loading branch information
ianhi authored Oct 29, 2021
2 parents b2cb4c9 + b41b5d2 commit ee5c6c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/lazy_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

def lazy_image_generator(idx):
rng = default_rng(idx)
return rng.random((10, 10))
return rng.random((rng.integers(5, 15), rng.integers(5, 15)))


labeller = image_labeller(
Expand Down
2 changes: 2 additions & 0 deletions mpl_image_labeller/_labeller.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ def _update_title(self):

def _update_displayed(self):
image = np.asarray(self._get_image(self._image_index))
# for some reason this keeps getting turned off by something
self._ax.set_autoscale_on(True)
self._im.set_data(image)
self._im.set_extent((-0.5, image.shape[1] - 0.5, image.shape[0] - 0.5, -0.5))
self._update_title()
Expand Down

0 comments on commit ee5c6c8

Please sign in to comment.