Skip to content

Commit

Permalink
switch order of setting ymin and ymax (#3371)
Browse files Browse the repository at this point in the history
* switch order of setting ymin and ymax

* change log

* .

* remove test because it requires image to be rendered
  • Loading branch information
cshanahan1 authored Dec 23, 2024
1 parent 6868bb5 commit bcf44af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ Bug Fixes

- Fixed bug with Plot Options select_all when data is float32. [#3366]

- Fixed an issue with back-to-back calls of set_limits and get_limits. [#3371]


Cubeviz
^^^^^^^
Expand Down
7 changes: 5 additions & 2 deletions jdaviz/configs/default/plugins/viewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,13 @@ def set_limits(self, x_min=None, x_max=None, y_min=None, y_max=None):
self.state.x_min = x_min
if x_max is not None:
self.state.x_max = x_max
if y_min is not None:
self.state.y_min = y_min
# NOTE: for some reason, setting ymax first avoids an issue
# where back-to-back calls of get_limits and set_limits
# give different results for y limits.
if y_max is not None:
self.state.y_max = y_max
if y_min is not None:
self.state.y_min = y_min

def get_limits(self):
"""Return current viewer axes limits.
Expand Down

0 comments on commit bcf44af

Please sign in to comment.