diff --git a/glue_jupyter/bqplot/image/state.py b/glue_jupyter/bqplot/image/state.py index f045f4ed..a8142f25 100644 --- a/glue_jupyter/bqplot/image/state.py +++ b/glue_jupyter/bqplot/image/state.py @@ -56,6 +56,7 @@ def __init__(self, *args, **kwargs): self.add_callback('level_mode', self._update_levels) self.add_callback('levels', self._update_labels) self.add_callback('attribute_display_unit', self._convert_units_c_limits, echo_old=True) + self._convert_units_c_limits(None, None) self._update_levels() diff --git a/glue_jupyter/bqplot/image/tests/test_visual.py b/glue_jupyter/bqplot/image/tests/test_visual.py index 3ef57110..56897fb7 100644 --- a/glue_jupyter/bqplot/image/tests/test_visual.py +++ b/glue_jupyter/bqplot/image/tests/test_visual.py @@ -29,6 +29,8 @@ def test_contour_units( assert_allclose(image.state.layers[0].levels, [0.1, 0.3, 0.5, 0.7, 0.9]) + image.state.layers[0].attribute_display_unit = 'mm' + image.state.layers[0].attribute_display_unit = 'km' image.state.layers[0].attribute_display_unit = 'm' assert_allclose(image.state.layers[0].levels, [100, 300, 500, 700, 900])