Skip to content

Commit

Permalink
allow for imshow_kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhi authored Oct 29, 2021
1 parent 9fa8daa commit 27afa0b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mpl_image_labeller/_labeller.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def __init__(
labelling_advances_image: bool = True,
N_images=None,
fig: Figure = None,
**imshow_kwargs,
):
"""
Parameters
Expand All @@ -49,6 +50,8 @@ def __init__(
fig : Figure
An empty figure to build the UI in. Use this to embed image_labeller into
a gui framework.
**imshow_kwargs :
kwargs to be passed to the imshow function that displays the images.
"""
self._images = images
if callable(images):
Expand Down Expand Up @@ -114,7 +117,8 @@ def _get_image(i):

self._image_index = 0
self._ax = self._fig.add_subplot(111)
self._im = self._ax.imshow(self._get_image(0), aspect="equal")
aspect = imshow_kwargs.pop('aspect', 'equal')
self._im = self._ax.imshow(self._get_image(0), aspect=aspect, **imshow_kwargs)

# shift axis to make room for list of keybindings
box = self._ax.get_position()
Expand Down

0 comments on commit 27afa0b

Please sign in to comment.