8000 Fully fixes #2 by fixing the scale bar too · magnunor/matplotlib@7b7fcbb · GitHub
[go: up one dir, main page]

Skip to content

Commit 7b7fcbb

Browse files
committed
Fully fixes matplotlib#2 by fixing the scale bar too
1 parent 1a54d39 commit 7b7fcbb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

hyperspy/signal.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,12 @@ def plot(self, axes_manager=None):
257257
if self.axes_manager._non_slicing_axes:
258258
self._plot.image_data_function = self._get_explorer
259259
self._plot.image_title = ''
260-
self._plot.pixel_size = \
261-
self.axes_manager._non_slicing_axes[0].scale
262-
self._plot.pixel_units = \
263-
self.axes_manager._non_slicing_axes[0].units
260+
if self.axes_manager.navigation_dimension == 1:
261+
scalebar_axis = self.axes_manager._slicing_axes[0]
262+
else:
263+
scalebar_axis = self.axes_manager._non_slicing_axes[-1]
264+
self._plot.pixel_size = scalebar_axis.scale
265+
self._plot.pixel_units = scalebar_axis.units
264266
self._plot.plot()
265267

266268
elif axes_manager.signal_dimension == 2:

0 commit comments

Comments
 (0)
0