Skip to content

Commit ae06a7a

Browse files
committed
Sort layers by their name when storing them
1 parent d3427b5 commit ae06a7a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/napari_matplotlib/base.py

+1
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ def _update_layers(self, event: napari.utils.events.Event) -> None:
183183
Update the ``layers`` attribute with currently selected layers and re-draw.
184184
"""
185185
self.layers = list(self.viewer.layers.selection)
186+
self.layers = sorted(self.layers, key=lambda layer: layer.name)
186187
self.on_update_layers()
187188
self._draw()
188189

0 commit comments

Comments
 (0)